Skip to content

Commit

Permalink
cosmetics
Browse files Browse the repository at this point in the history
  • Loading branch information
ronag committed Oct 9, 2020
1 parent 598f4ef commit 133adc5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/core/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class Request {
throw new InvalidArgumentError('headers array must be even')
}
for (let i = 0; i < headers.length; i += 2) {
processHeader(this, headers[i], headers[i + 1])
processHeader(this, headers[i + 0], headers[i + 1])
}
} else if (headers && typeof headers === 'object') {
for (const [key, val] of Object.entries(headers)) {
Expand Down Expand Up @@ -155,7 +155,7 @@ class Request {
}

function processHeader (request, key, val) {
if (typeof val === 'object' && val !== null) {
if (val && typeof val === 'object') {
throw new InvalidArgumentError(`invalid ${key} header`)
} else if (val === undefined) {
return
Expand Down

0 comments on commit 133adc5

Please sign in to comment.