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

Allow dynamic import() requests from any origin on any device. #9954

Merged
merged 2 commits into from Jun 7, 2018

Conversation

Projects
None yet
4 participants
@call-a3
Contributor

call-a3 commented Jun 6, 2018

A tweak to the change introduced in c4b5707 to fix #9952.
This will allow clients that don't support the * value in Access-Control-Allow-Headers,
but do specify the Access-Control-Request-Headers (such as electron 2.0.2) to use dynamic import.

Allow dynamic import() requests from any origin on any device.
A tweak to the change introduced in c4b5707 to fix #9952.
This will allow clients that don't support the * value in `Access-Control-Allow-Headers`,
but do specify the `Access-Control-Request-Headers` (such as electron 2.0.2) to use dynamic import.
@meteor-bot

This comment has been minimized.

meteor-bot commented Jun 6, 2018

@call-a3: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Meteor Contributor Agreement here: https://contribute.meteor.com/

@benjamn

Looking good, just a few notes!

@@ -66,7 +66,11 @@ function middleware(request, response) {
response.setHeader("Access-Control-Allow-Origin", "*");
if (request.method === "OPTIONS") {
response.setHeader("Access-Control-Allow-Headers", "*");
if (request.headers["access-control-request-headers"] !== undefined) {

This comment has been minimized.

@benjamn

benjamn Jun 6, 2018

Member

Do we need to worry about different possible capitalizations when checking for this header?

Also we typically test typeof value === "undefined" rather than relying on the undefined identifier, just because undefined is mutable in some environments.

This comment has been minimized.

@sebakerckhof

sebakerckhof Jun 6, 2018

Contributor

No need to worry about capitalization, all keys of headers are lower-cased by node.

@@ -66,7 +66,11 @@ function middleware(request, response) {
response.setHeader("Access-Control-Allow-Origin", "*");
if (request.method === "OPTIONS") {
response.setHeader("Access-Control-Allow-Headers", "*");
if (request.headers["access-control-request-headers"] !== undefined) {
response.setHeader("Access-Control-Allow-Headers", request.headers["access-control-request-headers"]);

This comment has been minimized.

@benjamn

benjamn Jun 6, 2018

Member

Especially if we end up having to check for multiple variations of this header, it would be good to store the value in a variable that we could reuse down here.

@benjamn

benjamn approved these changes Jun 7, 2018

@benjamn benjamn merged commit 0244680 into meteor:devel Jun 7, 2018

17 of 18 checks passed

ci/circleci: Clean Up CircleCI is running your tests
Details
CLA Author has signed the Meteor CLA.
Details
ci/circleci: Docs Your tests passed on CircleCI!
Details
ci/circleci: Get Ready Your tests passed on CircleCI!
Details
ci/circleci: Isolated Tests Your tests passed on CircleCI!
Details
ci/circleci: Test Group 0 Your tests passed on CircleCI!
Details
ci/circleci: Test Group 1 Your tests passed on CircleCI!
Details
ci/circleci: Test Group 10 Your tests passed on CircleCI!
Details
ci/circleci: Test Group 2 Your tests passed on CircleCI!
Details
ci/circleci: Test Group 3 Your tests passed on CircleCI!
Details
ci/circleci: Test Group 4 Your tests passed on CircleCI!
Details
ci/circleci: Test Group 5 Your tests passed on CircleCI!
Details
ci/circleci: Test Group 6 Your tests passed on CircleCI!
Details
ci/circleci: Test Group 7 Your tests passed on CircleCI!
Details
ci/circleci: Test Group 8 Your tests passed on CircleCI!
Details
ci/circleci: Test Group 9 Your tests passed on CircleCI!
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@benjamn benjamn added this to the Package Patches milestone Jun 7, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment