Skip to content

Commit

Permalink
fix duplicate header warning (#56491)
Browse files Browse the repository at this point in the history
logged when attaching 2+ headers due to excessive check

Co-authored-by: Elastic Machine <[email protected]>
  • Loading branch information
mshustov and elasticmachine authored Feb 3, 2020
1 parent 3d96e4c commit 598968f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/core/server/http/integration_tests/lifecycle.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,7 @@ describe('Auth', () => {
res.ok({
headers: {
'www-authenticate': 'from handler',
'another-header': 'yet another header',
},
})
);
Expand Down
2 changes: 1 addition & 1 deletion src/core/server/http/lifecycle/on_pre_response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ export function adoptToHapiOnPreResponseFormat(fn: OnPreResponseHandler, log: Lo
...(result.headers as any), // hapi types don't specify string[] as valid value
};
} else {
findHeadersIntersection(response.headers, result.headers, log);
for (const [headerName, headerValue] of Object.entries(result.headers)) {
findHeadersIntersection(response.headers, result.headers, log);
response.header(headerName, headerValue as any); // hapi types don't specify string[] as valid value
}
}
Expand Down

0 comments on commit 598968f

Please sign in to comment.