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

Pass source origin in all fetch requests #1772

Merged
merged 1 commit into from
Feb 5, 2016

Conversation

dvoytenko
Copy link
Contributor

Closes #1762.

@erwinmombay
Copy link
Member

@dvoytenko looks good to me, passing onto @cramforce

@erwinmombay erwinmombay assigned cramforce and unassigned erwinmombay Feb 4, 2016
const url = parseUrl(input);
const queryString = parseQueryString(url.search);
const querySourceOrigin = queryString[SOURCE_ORIGIN_PARAM];
if (!querySourceOrigin) {
Copy link
Member

Choose a reason for hiding this comment

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

if (SOURCE_ORIGIN_PARAM in queryString) {
throw …
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@dvoytenko
Copy link
Contributor Author

@cramforce I've addressed the comments. And I also added the check for AMP-Access-Control-Allow-Source-Origin. PTAL.

const url = parseUrl(input);
const query = parseQueryString(url.search);
if (SOURCE_ORIGIN_PARAM in query ||
decodeURI(input).indexOf(SOURCE_ORIGIN_PARAM) != -1) {
Copy link
Member

Choose a reason for hiding this comment

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

As discussed, remove this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@cramforce
Copy link
Member

LGTM with one comment

@dvoytenko dvoytenko force-pushed the access28 branch 2 times, most recently from 2b5b294 to d6df7c4 Compare February 4, 2016 22:54
dvoytenko added a commit that referenced this pull request Feb 5, 2016
Pass source origin in all fetch requests
@dvoytenko dvoytenko merged commit 0816d4c into ampproject:master Feb 5, 2016
@dvoytenko dvoytenko deleted the access28 branch February 5, 2016 01:31
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