Skip to content
This repository has been archived by the owner on Sep 14, 2022. It is now read-only.

swagger is overriding cors headers with it's own. #93

Closed
muanis opened this issue Jan 29, 2014 · 2 comments
Closed

swagger is overriding cors headers with it's own. #93

muanis opened this issue Jan 29, 2014 · 2 comments

Comments

@muanis
Copy link
Contributor

muanis commented Jan 29, 2014

On line 74 of swagger.js (https://github.com/wordnik/swagger-node-express/blob/master/Common/node/swagger.js#L74) cors headers are overwritten, this way if you use nodejs cors (https://npmjs.org/package/cors) or express cors (https://npmjs.org/package/express-cors) the Acces-Control-Allow-xxx headers are all overwritten.

I'm working on a patch to at least fix that for my usage, but want to get it fixed for good . Any suggestions on what approach is better? I would say swagger shouldn't deal with this headers and let the cors module, that works as a middleware handle this config.

Suggestions appreciated. :-)

@fehguy
Copy link
Contributor

fehguy commented Feb 4, 2014

yes, you're right that it shouldn't rely on it's own headers. if you can update the sample with the cors package and send a PR, i'll see about merging it.

@muanis
Copy link
Contributor Author

muanis commented Feb 5, 2014

ok. I'll do it and PR, thanks!

muanis pushed a commit to muanis/swagger-node-express that referenced this issue Feb 7, 2014
…agger module, added relevant information to README.md Related to swagger-api#93
@fehguy fehguy closed this as completed May 19, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants