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 CORS headers to eventsource #168

Merged
merged 3 commits into from
Oct 22, 2014
Merged

Add CORS headers to eventsource #168

merged 3 commits into from
Oct 22, 2014

Conversation

brycekahle
Copy link
Contributor

EventSource (SSE) now has support for CORS in some browsers.

headers = req.headers['access-control-request-headers']
if headers
res.setHeader('Access-Control-Allow-Headers', headers)
res.setHeader('Access-Control-Allow-Credentials', 'true')

Choose a reason for hiding this comment

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

This patch will generate broken CORS headers as Access-Control-Allow-Credentials can not be set to true if Access-Control-Allow-Origin is set to *.

@brycekahle
Copy link
Contributor Author

@3rd-Eden Thanks for the tips.

brycekahle added a commit that referenced this pull request Oct 22, 2014
Add CORS headers to eventsource
@brycekahle brycekahle merged commit 259f0eb into master Oct 22, 2014
@brycekahle brycekahle deleted the cors-eventsource branch October 22, 2014 04:15
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.

2 participants