Skip to content

Access-Control-Expose-Headers response header duplicate values #2950

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

Closed
craigbeck opened this issue Nov 21, 2015 · 3 comments
Closed

Access-Control-Expose-Headers response header duplicate values #2950

craigbeck opened this issue Nov 21, 2015 · 3 comments
Assignees
Labels
bug Bug or defect
Milestone

Comments

@craigbeck
Copy link
Contributor

  • Hapi v11.1.1
  • making CORS request failing in Chrom, Safari, succeeds in Firefox
  • notice duplicate values in Access-Control-Expose-Headers response header
access-control-expose-headers: WWW-Authenticate,Server-Authorization,WWW-Authenticate,Server-Authorization

Header gets set in cors.js line 140 and get appended to in cors.js line 168

@craigbeck
Copy link
Contributor Author

I have a failing test.

It looks like with option of cors: true line 140 doesn't get hit, so line 168 sets the correct values. When using non-default CORS configuratoin, line 140 and line 160 get executed and the header values get duplicated.

@craigbeck
Copy link
Contributor Author

I'm unclear as to a fix or what exactly are the conditions for both lines 140 and 168 to get executed. The first couple of tests in #2953 fail but don't double-append (nothing is appended). I added an assertion to 'matches allowed headers (Origin explicit)' test that executes both lines that shows the issue.

hueniverse added a commit that referenced this issue Nov 21, 2015
@hueniverse
Copy link
Contributor

The three new tests you added are not necessary. The two that fail are because your config and origin do not match (missing tailing / in the config). The last change is the actual problem and I'll fix it shortly.

@hueniverse hueniverse added the bug Bug or defect label Nov 21, 2015
@hueniverse hueniverse added this to the 11.1.2 milestone Nov 21, 2015
@hueniverse hueniverse self-assigned this Nov 21, 2015
@lock lock bot locked as resolved and limited conversation to collaborators Jan 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Bug or defect
Projects
None yet
Development

No branches or pull requests

2 participants