Skip to content
This repository was archived by the owner on Jul 19, 2019. It is now read-only.

added permissive CORS header middleware function #120

Closed
wants to merge 2 commits into from

Conversation

MaxBittker
Copy link
Contributor

Hi again... terribly sorry for causing noise and opening a new issue, I just had ran into a problem squashing the commits.

previous discussion:
#118

app.use(function(req, res, next) {
//set permissive CORS headers
res.setHeader('Access-Control-Allow-Origin', '*');
res.setHeader('Access-Control-Allow-Methods', 'GET,OPTIONS,HEAD,PUT,POST,DELETE,PATCH');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you really need all of these? I would think that just Access-Control-Allow-Origin is all you need.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, except I believe that the preflight is also needed for POST? so I could remove the method and headers lines.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

after testing, I couldn't recreate this scenario with Firefox or chromium, so i remove the extra statements per your suggestion

zpao added a commit that referenced this pull request Jan 26, 2016
added permissive CORS header middleware function
@zpao
Copy link
Member

zpao commented Jan 26, 2016

Squashed and pushed as 3fba2d4. Thanks!

@zpao zpao closed this Jan 26, 2016
@MaxBittker
Copy link
Contributor Author

thanks for maintaining the tutorial! enjoyed it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants