mirror of https://github.com/sundowndev/http.git
revert: revert converting header names to lowercase
parent
53287ddf80
commit
2b0f463416
|
@ -1,15 +1,9 @@
|
|||
import KY from 'ky-universal'
|
||||
|
||||
class HTTP {
|
||||
constructor({ headers, ...defaults }, ky = KY) {
|
||||
const _headers = {}
|
||||
for (const name in headers) {
|
||||
_headers[name.toLowerCase()] = headers[name]
|
||||
}
|
||||
|
||||
constructor(defaults, ky = KY) {
|
||||
this._defaults = {
|
||||
hooks: {},
|
||||
headers: _headers,
|
||||
...defaults
|
||||
}
|
||||
|
||||
|
@ -17,8 +11,6 @@ class HTTP {
|
|||
}
|
||||
|
||||
setHeader(name, value) {
|
||||
name = name.toLowerCase()
|
||||
|
||||
if (!value) {
|
||||
delete this._defaults.headers[name];
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue