Skip to content

Commit

Permalink
refactor: use way more Object.entries
Browse files Browse the repository at this point in the history
  • Loading branch information
dnalborczyk committed Jul 9, 2022
1 parent 76582e0 commit 86c5280
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/events/http/HttpServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -965,18 +965,18 @@ export default class HttpServer {
const headers = {}

if (result && result.headers) {
keys(result.headers).forEach((header) => {
headers[header] = (headers[header] || []).concat(
result.headers[header],
)
entries(result.headers).forEach(([headerKey, headerValue]) => {
headers[headerKey] = (headers[headerKey] || []).concat(headerValue)
})
}
if (result && result.multiValueHeaders) {
keys(result.multiValueHeaders).forEach((header) => {
headers[header] = (headers[header] || []).concat(
result.multiValueHeaders[header],
)
})
entries(result.multiValueHeaders).forEach(
([headerKey, headerValue]) => {
headers[headerKey] = (headers[headerKey] || []).concat(
headerValue,
)
},
)
}

log.debug('headers', headers)
Expand Down

0 comments on commit 86c5280

Please sign in to comment.