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

add support for CORS headers #172

Merged
merged 2 commits into from Aug 31, 2018
Merged

add support for CORS headers #172

merged 2 commits into from Aug 31, 2018

Conversation

elrayle
Copy link
Contributor

@elrayle elrayle commented Aug 30, 2018

  • Added CORS support as a configurable option that can be enable or disabled. It is disabled by default to maintain backward compatibility.
  • When CORS is enabled...
    • Adds CORS response 'Access-Control-Allow-Origin' for all GET requests
    • Handles OPTIONS method requests for supported routes and responds with supported methods and allow origin header
  • When CORS is disabled...
    • The 'Access-Control-Allow-Origin' header is not added to GET requests
    • If OPTIONS method is requested, a 501 (not supported) response is returned

REF: https://fetch.spec.whatwg.org/#http-cors-protocol

* Added CORS support as a configurable option that can be enable or disabled.  It is disabled by default to maintain backward compatibility.
* When CORS is enabled...
  * Adds CORS response 'Access-Control-Allow-Origin' for all GET requests
  * Handles OPTIONS method requests for supported routes and responds with supported methods and allow origin header
* When CORS is disabled...
  * The 'Access-Control-Allow-Origin' header is not added to GET requests
  * If OPTIONS method is requested, a 501 (not supported) response is returned

REF: https://fetch.spec.whatwg.org/#http-cors-protocol
@awead awead merged commit 7f38678 into master Aug 31, 2018
@awead awead deleted the cors_headers branch August 31, 2018 15:21
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.

None yet

2 participants