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

Enable CORS #85

Merged
merged 1 commit into from
Aug 14, 2015
Merged

Enable CORS #85

merged 1 commit into from
Aug 14, 2015

Conversation

abbycabs
Copy link
Member

@abbycabs
Copy link
Member Author

This will let us start working on #72

@abbycabs
Copy link
Member Author

@guahanweb - could use a review here if you're familiar w/ express!

@@ -54,6 +54,12 @@ module.exports = function (badgerService) {
state: 'none'
});

app.use(function (req, res, next) {
res.header('Access-Control-Allow-Origin', '*');
res.header('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept');

Choose a reason for hiding this comment

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

The only thing to consider is whether there are ever going to be additional headers that may be sent from the client. Things like Cache-Control or other browser headers that may be injected?

This is a pretty generic "catch-all" that is good for general CORS. Just be sure your client isn't attaching any unexpected headers.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is a good point - we should def revisit when we add a CDN.

@guahanweb
Copy link

cr:gh - LGTM, just consider the header comment. If you're confident with those, I'd say merge it!

@abbycabs
Copy link
Member Author

Thanks @guahanweb :)

abbycabs added a commit that referenced this pull request Aug 14, 2015
@abbycabs abbycabs merged commit 6811e28 into master Aug 14, 2015
guahanweb pushed a commit to guahanweb/PaperBadger that referenced this pull request Aug 19, 2015
@abbycabs abbycabs deleted the enable-cors branch September 1, 2015 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants