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

added support for CORS HTTP headers #166

Merged
merged 5 commits into from
Sep 2, 2015
Merged

Conversation

bumi
Copy link
Contributor

@bumi bumi commented Aug 28, 2015

Sets the Cross-Origin Resource Sharing (CORS) headers in a global express middleware.
This option is configurable and disabled by default.

To enable CORS use the following config entry:

[http]
cors: true

See #162 for original PR discussion about enabling CORS. This PR makes CORS configurable and disables CORS by default.

I have a test that checks if CORS is disabled (having only the default configuration). But I am not sure how to change a global option on the fly within a test that affects the server bootup. - if needed.

Sets the Cross-Origin Resource Sharing (CORS) headers in a global express middleware.
This option is configurable and disabled by default.

To enable CORS use the following config entry:

[http]
cors: true
@bumi
Copy link
Contributor Author

bumi commented Aug 28, 2015

I think the travis error is related to this: https://twitter.com/travisci/status/637183387669778432 - so should be fixed when travis solved the ios problem

@taoeffect
Copy link
Member

@bumi Yeah, iojs just broke too many things with 3.0. It's actually a change that breaks compatibility with hiredis that's causing it to fail.

It looks like they just recently fixed the issue, however, so bumping the hiredis version in package.json to 0.4.1 should fix it. Maybe try sending a commit with that change? It should fix the build error.

@taoeffect
Copy link
Member

Odd that it's still erroring, I mentioned it to the hiredis team. I will review your PR ASAP and get back to you on the rest.

@@ -41,7 +41,7 @@
"bottleneck": "1.5.x",
"event-stream": "3.2.2",
"express": "4.11.2",
"hiredis": "0.4.0",
"hiredis": "~0.4.1",
Copy link
Member

Choose a reason for hiding this comment

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

This should not include the tilde. We've had issues where DNSChain failed to work on future installs because of an updated library, so we want to stick to precise version numbers.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, do you still want that change in this PR?
saw the hiredis-node comment on gcc.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, please remove the tilde, it seems like they did fix it and we just need to update our .travis.yml to tell Travis to install g++-4.8. If you want to add these lines yourself as part of the PR you're welcome to, otherwise I'll do later on when I get a chance.

Also, don't forget to update the warning message (see comment below).

Copy link
Member

Choose a reason for hiding this comment

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

(Oh, and if you decide to update the .travis.yml file, you should also add these lines as well to force the compiler version.)

@bumi
Copy link
Contributor Author

bumi commented Aug 29, 2015

hmmm. ja, will try to debug the build error tomorrow. it's not really obvious to me what's going on.

@taoeffect
Copy link
Member

will try to debug the build error tomorrow.

You don't need to do anything about that, don't worry. The build works on nodejs 0.10 and 0.12. That's good enough for me. This is a bug in the hiredis library due to broken compatibility with iojs 3.

I'm done with my review. You should also update the README to add your name to the list of Contributors. 😄

Michael Bumann added 2 commits August 31, 2015 15:45
this is a requirement by the hiredis-node dependency which otherwise
fails on iojs.
also fixed hiredis version to the latest 0.4.1 release
as per request :)
@bumi
Copy link
Contributor Author

bumi commented Sep 1, 2015

OK, update the PR with your latest comments.
it also includes the changes for travis (which is now actually green) please review this commit I've adopted it from the hiredis travis config.

thanks for the support.

@taoeffect
Copy link
Member

Great job @bumi! It's so funny, we've fixed iojs and broke the other two builds. I can't wait until the two projects merge, then I can have Travis just target one node platform. (Maybe they already have, I haven't been keeping up.)

I'm going to merge this and deal with Travis later. Of course, you or anyone else is welcome to help with that, as at the moment my attention is somewhat divided and focused in other areas. But I'm adding releasing a minor point update to my near-term TODO.

Thanks so much for your great work with this! 😄 👍

taoeffect added a commit that referenced this pull request Sep 2, 2015
added support for CORS HTTP headers
@taoeffect taoeffect merged commit 8c653d4 into okTurtles:master Sep 2, 2015
@taoeffect
Copy link
Member

It's so funny, we've fixed iojs and broke the other two builds.

Weird! After I merged it Travis appears fixed! No idea why it showed your PR as broken but worked after merge, but am glad that's the case, one less thing to fix. :)

@bumi
Copy link
Contributor Author

bumi commented Sep 2, 2015

yay, thanks a lot!
(travis was green here: https://travis-ci.org/bumi/dnschain/builds/78244772)

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