Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix array headers #1598

Merged
merged 3 commits into from
Aug 11, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
perf(util): handle header array values
  • Loading branch information
mateonunez committed Aug 11, 2022
commit 3cb953a486031528bc88d8e711a4504bceff8666
6 changes: 5 additions & 1 deletion lib/core/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,11 @@ function parseHeaders (headers, obj = {}) {
const key = headers[i].toString().toLowerCase()
let val = obj[key]
if (!val) {
obj[key] = headers[i + 1].toString()
if (Array.isArray(headers[i + 1])) {
obj[key] = headers[i + 1]
} else {
obj[key] = headers[i + 1].toString()
}
} else {
if (!Array.isArray(val)) {
val = [val]
Expand Down