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

Make import statements set the importing script as the referrer #1270

Merged
merged 1 commit into from
May 19, 2016

Conversation

domenic
Copy link
Member

@domenic domenic commented May 17, 2016

Fixes #1150. Previously, they would set the top-level document (that
requested the root of the module script tree) as the referrer. This
makes more sense, being for example consistent with CSS @import.

Fixes #1150. Previously, they would set the top-level document (that
requested the root of the module script tree) as the referrer. This
makes more sense, being for example consistent with CSS @import.
@annevk
Copy link
Member

annevk commented May 18, 2016

Okay, so the referrer is the root, but the Origin is the requester of the root? I guess that makes sense. @TanviHacks @estark37 @bzbarsky, thoughts?

The scenario here is

<script type=module src=modulescript.js>

and then modulescript.js (root) declaratively (not through script execution, so the base URL and such will be different) fetching some further resources.

This is similar to ```that has@import ...`. However, in that case CORS is not used for the URL declared by `@import`. Here it would be inherited.

@bzbarsky
Copy link
Contributor

That seems reasonable to me.

@annevk
Copy link
Member

annevk commented May 19, 2016

On further reflection I think this is the most reasonable thing to do. Otherwise you get confused deputy attacks.

@annevk annevk merged commit a6c1171 into master May 19, 2016
@annevk annevk deleted the module-scripts-referrer branch May 19, 2016 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants