revert: revert converting header names to lowercase

master
pooya parsa 2019-05-30 02:47:12 +04:30
parent 53287ddf80
commit 2b0f463416
1 changed files with 1 additions and 9 deletions

View File

@ -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 {