Skip to content

Cross-Origin-Resource-Policy tests#11171

Merged
foolip merged 1 commit into
web-platform-tests:masterfrom
youennf:wpt-export-for-webkit-185840
Jun 18, 2018
Merged

Cross-Origin-Resource-Policy tests#11171
foolip merged 1 commit into
web-platform-tests:masterfrom
youennf:wpt-export-for-webkit-185840

Conversation

@youennf

@youennf youennf commented May 25, 2018

Copy link
Copy Markdown
Contributor

These are initial tests targeting whatwg/fetch#733
These are based on https://bugs.webkit.org/show_bug.cgi?id=185840.

@annevk annevk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

In general this looks great, but I found a couple issues. (I annotated them in one file, but they apply to most tests.)

loadScript(remoteBaseURL + "resources/script.py?corp=same&acao=*", ko);

title = "Cross-origin no-cors script load with a 'Cross-Origin-Resource-Policy: same-site' response header.";
loadScript(remoteBaseURL + "resources/script.py?corp=same-site&acao=*", ko);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Since remote host will be 'www1.' + ORIGINAL_HOST, wouldn't this be ok as it's same site?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This concern applies more generally it seems.

}, title);
}

title = "Same-origin script load with a 'Cross-Origin-Resource-Policy: same' response header.";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you change this to pass the title in as an argument? This seems like a rather strange style.

@annevk

annevk commented Jun 7, 2018

Copy link
Copy Markdown
Member

The other thing that'd be nice to test is ensuring the header is properly parsed. E.g., same-ORIGIN does not match, same-origin, same-site does not match, etc.

@annevk annevk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for addressing the nits and writing all these. I created two more small PRs that cover some remaining aspects.

Let's wait with landing this until next week so we can land all the various pieces together.

@annevk

annevk commented Jun 8, 2018

Copy link
Copy Markdown
Member

The reason this is timing out is because it changes common/get-host-info.sub.js so we'll need an admin to land this next week.

annevk added a commit to whatwg/fetch that referenced this pull request Jun 8, 2018
This header makes it easier for sites to block unwanted "no-cors"
cross-origin requests.

Tests:

* web-platform-tests/wpt#11171
* web-platform-tests/wpt#11427
* web-platform-tests/wpt#11428

Follow-up: #760.

Fixes #687.
@annevk annevk force-pushed the wpt-export-for-webkit-185840 branch from d591b6a to eab3b0e Compare June 18, 2018 09:31
@foolip foolip merged commit 53f7340 into web-platform-tests:master Jun 18, 2018
@foolip

foolip commented Jun 18, 2018

Copy link
Copy Markdown
Member

Rebase+merge button pressed as requested by @annevk on IRC.

annevk added a commit to whatwg/fetch that referenced this pull request Jun 18, 2018
This header makes it easier for sites to block unwanted "no-cors"
cross-origin requests.

Tests:

* web-platform-tests/wpt#11171
* web-platform-tests/wpt#11427
* web-platform-tests/wpt#11428

Follow-up: #760 & #767.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants