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' import KY from 'ky-universal'
class HTTP { class HTTP {
constructor({ headers, ...defaults }, ky = KY) { constructor(defaults, ky = KY) {
const _headers = {}
for (const name in headers) {
_headers[name.toLowerCase()] = headers[name]
}
this._defaults = { this._defaults = {
hooks: {}, hooks: {},
headers: _headers,
...defaults ...defaults
} }
@ -17,8 +11,6 @@ class HTTP {
} }
setHeader(name, value) { setHeader(name, value) {
name = name.toLowerCase()
if (!value) { if (!value) {
delete this._defaults.headers[name]; delete this._defaults.headers[name];
} else { } else {