Skip to content

Cache crossorigin test - #24370

Merged
bors-servo merged 2 commits into
servo:masterfrom
jdm:cache-crossorigin-test
Oct 7, 2019
Merged

bors-servo merged 2 commits into
servo:masterfrom
jdm:cache-crossorigin-test

Conversation

@jdm

@jdm jdm commented Oct 4, 2019 •

Copy link
Copy Markdown
Member

This adds a test for #24356 to ensure that we don't regress our cache behaviour.


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • There are tests for these changes

This change is Reviewable

@highfive

highfive commented Oct 4, 2019

Copy link
Copy Markdown

Heads up! This PR modifies the following files:

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Oct 4, 2019
@jdm jdm mentioned this pull request Oct 4, 2019
5 tasks

@gterzian gterzian 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.

Looks good to me besides one suggestion on the URL, I have tested this with #24318 both with the current state, and with my suggested changes, and it passes in both cases.

}
}

const url = "http://{{hosts[][www]]}}:{{ports[http][0]}}/html/semantics/scripting-1/the-script-element/is-script-goal.js?pipe=trickle(d5)|header(Cache-Control,max-age=3600)|header(Pragma,)|header(Expires,36000)";

@gterzian gterzian Oct 5, 2019 •

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.

When I logged this locally, it came out as

  • http://www.web-platform.test:8000/html/semantics/scripting-1/the-script-element/is-script-goal.js?pipe=trickle(d5)|header(Cache-Control,max-age=3600)|header(Pragma,)|header(Expires,36000,
    with location.href coming out as
  • http://web-platform.test:8000/_mozilla/mozilla/cache_crossorigin_response.sub.html.

So that appears same-origin to me.

I think changing it to http://{{hosts[][www1]]}}... would make it cross-origin.

@gterzian gterzian Oct 5, 2019 •

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.

Ah, I now see the www. is missing from the url of the test, so it's basically the same. It might be clearer and more robust to use www1, I wasn't aware the test are run without the leading www, and that might be subject to change? Many other cross-origin tests, for example in webmessaging, use www1.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Clearer is debatable, since there are lots of tests that use the www host. Robust is also debatable, since changing the default host to use a subdomain is not a realistic concern.

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.

Makes sense.

@jdm

jdm commented Oct 7, 2019

Copy link
Copy Markdown
Member Author

@bors-servo r=gterzian

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit b282ed9 has been approved by gterzian

@highfive highfive assigned gterzian and unassigned SimonSapin Oct 7, 2019
@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. labels Oct 7, 2019
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit b282ed9 with merge 37ab273...

bors-servo pushed a commit that referenced this pull request Oct 7, 2019
Cache crossorigin test

This adds a test for #24356 to ensure that we don't regress our cache behaviour.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] There are tests for these changes

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/24370)
<!-- Reviewable:end -->
@bors-servo

Copy link
Copy Markdown
Contributor

☀️ Test successful - linux-rel-css, linux-rel-wpt, status-taskcluster
Approved by: gterzian
Pushing 37ab273 to master...

@bors-servo
bors-servo merged commit b282ed9 into servo:master Oct 7, 2019
@highfive highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Oct 7, 2019
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.

5 participants