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

Preflight headers are merged to the actual request's headers #2592

Closed
thiagohirata opened this issue May 24, 2019 · 0 comments
Closed

Preflight headers are merged to the actual request's headers #2592

thiagohirata opened this issue May 24, 2019 · 0 comments

Comments

@thiagohirata
Copy link
Contributor

Basic info:

  • Node.js version: v12.2.0
  • jsdom version: 15.1.0

Description

After sending and validating the preflight request when sending a CORS request, before validating the CORS for the actual request, the headers present in the preflight response are merged into the actual request response.

Checking the history of this code, this behavior was introduced when the preflight implementation didn't validate the CORS for the preflight request, and made a single combined check for the headers of both responses.

This doesn't follow the W3C recommendations (https://www.w3.org/TR/cors/#preflight-request), and it introduces errors, like when the called API return a different value for Access-Control-Allow-Origin between the preflight and the actual response.

thiagohirata added a commit to thiagohirata/jsdom that referenced this issue May 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant