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

fix(gatsby): Set CORS to * in serve #14483

Merged
merged 4 commits into from
Aug 14, 2019

Conversation

stutrek
Copy link
Contributor

@stutrek stutrek commented Jun 1, 2019

I'm a long time user, first time contributor. Thanks for the great framework, the development experience for using and editing Gatsby is incredible.

Description

Access control headers were added to the server about a month ago, using the host provided from the command line. I am running the server with gatsby serve --host 0.0.0.0 --port 80 because it's being served on multiple domains, with routing and https handled before Gatsby. Currently these headers are served:

image

Unless I'm misunderstanding something, access control headers aren't useful in this situation because they'll always be the domain the browser is already on (with the exception of my 0.0.0.0 scenario). These headers were added here as part of #12128 so there may be a situation with assetPrefix on another domain that I'm unaware of. @DSchau can you confirm or deny? Should this be a CLI flag when running the server insetad?

I might not be running the tests properly, no tests failed after this change.

Related Issues

Introduced by #12128

@stutrek stutrek requested a review from a team as a code owner June 1, 2019 18:33
@stutrek
Copy link
Contributor Author

stutrek commented Jun 1, 2019

I don't have the slightest idea what to do about this Danger failure.

@pieh
Copy link
Contributor

pieh commented Jun 4, 2019

This might be unnecesary or changed after #14443 - will do some investigation.

I don't have the slightest idea what to do about this Danger failure.

This is flake - somethings Peril/danger (tools we use for some workflows automation) errors out randomly with confusing message. You can ignore it

@pieh
Copy link
Contributor

pieh commented Jun 14, 2019

Ok. let's not remove cors entirely - but with #14443 we will be able to use wildcard for allowed origins (and remove allow-credentials).

@pieh pieh added the status: blocked This issue/PR can't be solved at the moment and shouldn't be closed/merged label Jul 17, 2019
@pieh
Copy link
Contributor

pieh commented Jul 17, 2019

This is blocked until #14443 is merged.

@sidharthachatterjee sidharthachatterjee removed the status: blocked This issue/PR can't be solved at the moment and shouldn't be closed/merged label Aug 14, 2019
@sidharthachatterjee sidharthachatterjee changed the title remove access control headers fix(gatsby): Set CORS to * in serve Aug 14, 2019
Copy link
Contributor

@sidharthachatterjee sidharthachatterjee left a comment

Choose a reason for hiding this comment

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

This can go in now!

Thank you so much 👍

@sidharthachatterjee sidharthachatterjee merged commit 74959ab into gatsbyjs:master Aug 14, 2019
@gatsbot
Copy link

gatsbot bot commented Aug 14, 2019

Holy buckets, @stutrek — we just merged your PR to Gatsby! 💪💜

Gatsby is built by awesome people like you. Let us say “thanks” in two ways:

  1. We’d like to send you some Gatsby swag. As a token of our appreciation, you can go to the Gatsby Swag Store and log in with your GitHub account to get a coupon code good for one free piece of swag. We’ve got Gatsby t-shirts, stickers, hats, scrunchies, and much more. (You can also unlock even more free swag with 5 contributions — wink wink nudge nudge.) See gatsby.dev/swag for details.
  2. We just invited you to join the Gatsby organization on GitHub. This will add you to our team of maintainers. Accept the invite by visiting https://github.com/orgs/gatsbyjs/invitation. By joining the team, you’ll be able to label issues, review pull requests, and merge approved pull requests.

If there’s anything we can do to help, please don’t hesitate to reach out to us: tweet at @gatsbyjs and we’ll come a-runnin’.

Thanks again!

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.

3 participants