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

Corsadaptor support origin #498

Merged
merged 3 commits into from
Feb 10, 2022

Conversation

samutamm
Copy link
Contributor

@samutamm samutamm commented Feb 7, 2022

Resolve #483 and #484

As described in issue #483, currently CORSAdaptor support only CORS pre-flight requests. It does not help in enabling CORS for common usecase, where frontend and backend of an application have different origins. This testcase illustrates it in detail.

This PR adds new parameter supportCORSRequest. When true, CORSAdaptor handles both CORS pre-flight and CORS requests and supports the testcase above. When false, by default, the current logic is used.

Reference: https://fetch.spec.whatwg.org/#http-requests

Thanks @jthann for the testcase and PR #484, I included the proposed changes in this PR.

Samu Tamminen and others added 2 commits February 7, 2022 13:06
Co-authored-by: hanjuntao <[email protected]>
Co-authored-by: hanjuntao <[email protected]>
@samutamm samutamm merged commit c6b1670 into easegress-io:main Feb 10, 2022
@samutamm samutamm deleted the corsadaptor-support-origin branch February 10, 2022 02:16
@samutamm samutamm mentioned this pull request Apr 2, 2022
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

Successfully merging this pull request may close these issues.

CORSAdaptor should support CORS requests with "Origin" header
3 participants