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

Filter file: and about: responses opaquely #25687

Merged
merged 1 commit into from Feb 11, 2020
Merged

Conversation

@pshaughn
Copy link
Member

pshaughn commented Feb 4, 2020

file: and about: schemes were being treated like data: for cors purposes, when in fact they should have been subject to opaque response filtering. A comment indicated that this was necessary for some CSS tests, but I think the comment was out of date; the only tests depending on the unfiltered responses are unit tests that do not test any CSS functionality. I've updated those tests to now test for the opaque-filtering itself.


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #25686
  • There are tests for these changes, but also some loss of unit test coverage (#25693) and a newly failing test case (#25692)
@highfive
Copy link

highfive commented Feb 4, 2020

Heads up! This PR modifies the following files:

@highfive
Copy link

highfive commented Feb 4, 2020

warning Warning warning

  • These commits modify net code, but no tests are modified. Please consider adding a test!
@pshaughn
Copy link
Member Author

pshaughn commented Feb 4, 2020

@bors-servo try=wpt

@bors-servo
Copy link
Contributor

bors-servo commented Feb 4, 2020

Trying commit 7f4e0b5 with merge e554548...

bors-servo added a commit that referenced this pull request Feb 4, 2020
Try removing "file" and "about" from taint-exceptions, see what results

<!-- Please describe your changes on the following line: -->
Best-case scenario: fix #25686
Expected outcome: find out which test the comment on the code I deleted was referring to.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [ ] `./mach build -d` does not report any errors
- [ ] `./mach test-tidy` does not report any errors
- [ ] These changes fix #___ (GitHub issue number if applicable)

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because ___

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
@bors-servo
Copy link
Contributor

bors-servo commented Feb 4, 2020

💔 Test failed - status-taskcluster

@pshaughn
Copy link
Member Author

pshaughn commented Feb 4, 2020

Two unit test failures, the important part of the stack trace being:
14: main::fetch::test_fetch_aboutblank
at components/net/tests/fetch.rs:118
14: main::fetch::test_fetch_file
at components/net/tests/fetch.rs:211

WPT failures:

  ▶ OK [expected TIMEOUT] /workers/constructors/Worker/same-origin.html
  ▶ Unexpected subtest result in /workers/constructors/Worker/same-origin.html:
  └ PASS [expected TIMEOUT] about_blank
  ▶ Unexpected subtest result in /eventsource/eventsource-constructor-non-same-origin.htm:
  │ FAIL [expected PASS] EventSource: constructor (act as if there is a network error) (about:blank)
  │   → assert_equals: expected 2 but got 0
  │ 
  │ fetchFail/</source.onerror/<@http://web-platform.test:8000/eventsource/eventsource-constructor-non-same-origin.htm:17:15
  │ Test.prototype.step@http://web-platform.test:8000/resources/testharness.js:2024:25
  └ fetchFail/</source.onerror@http://web-platform.test:8000/eventsource/eventsource-constructor-non-same-origin.htm:16:18
  ▶ Unexpected subtest result in /xhr/send-non-same-origin.htm:
  └ PASS [expected FAIL] XMLHttpRequest: send() - non same-origin (about:blank)
  ▶ Unexpected subtest result in /fetch/api/basic/scheme-about.any.html:
  └ PASS [expected FAIL] Fetching about:blank with method GET is KO
  ▶ Unexpected subtest result in /fetch/api/basic/scheme-about.any.html:
  └ PASS [expected FAIL] Fetching about:blank with method PUT is KO
  ▶ Unexpected subtest result in /fetch/api/basic/scheme-about.any.html:
  └ PASS [expected FAIL] Fetching about:blank with method POST is KO
  ▶ Unexpected subtest result in /fetch/api/basic/scheme-about.any.worker.html:
  └ PASS [expected FAIL] Fetching about:blank with method GET is KO
  ▶ Unexpected subtest result in /fetch/api/basic/scheme-about.any.worker.html:
  └ PASS [expected FAIL] Fetching about:blank with method PUT is KO
  ▶ Unexpected subtest result in /fetch/api/basic/scheme-about.any.worker.html:
  └ PASS [expected FAIL] Fetching about:blank with method POST is KO
  ▶ Unexpected subtest result in /eventsource/dedicated-worker/eventsource-constructor-non-same-origin.htm:
  │ FAIL [expected PASS] dedicated worker - EventSource: constructor (act as if there is a network error) (about:blank)
  │   → assert_equals: source.readyState expected 2 but got 0
  │ 
  │ fetchFail/</worker.onmessage/<@http://web-platform.test:8000/eventsource/dedicated-worker/eventsource-constructor-non-same-origin.htm:19:15
  │ Test.prototype.step@http://web-platform.test:8000/resources/testharness.js:2024:25
  └ fetchFail/</worker.onmessage@http://web-platform.test:8000/eventsource/dedicated-worker/eventsource-constructor-non-same-origin.htm:17:18
@pshaughn pshaughn force-pushed the pshaughn:taintfile branch from 7f4e0b5 to 2398dab Feb 5, 2020
@highfive highfive removed the S-tests-failed label Feb 5, 2020
@pshaughn pshaughn marked this pull request as ready for review Feb 5, 2020
@pshaughn pshaughn changed the title Try removing "file" and "about" from taint-exceptions, see what results Filter file: and about: responses opaquely Feb 5, 2020
@pshaughn pshaughn force-pushed the pshaughn:taintfile branch 2 times, most recently from bb1a3b4 to 4f5edf0 Feb 5, 2020
@pshaughn
Copy link
Member Author

pshaughn commented Feb 5, 2020

I apparently did not push the same unit tests I was actually running and I need to detangle that

@pshaughn pshaughn force-pushed the pshaughn:taintfile branch 2 times, most recently from 7f8b7a9 to 9ca8f36 Feb 5, 2020
@bors-servo
Copy link
Contributor

bors-servo commented Feb 11, 2020

The latest upstream changes (presumably #25695) made this pull request unmergeable. Please resolve the merge conflicts.

Copy link
Member

jdm left a comment

I'm pleased that we can remove this special case now!

components/net/tests/fetch.rs Outdated Show resolved Hide resolved
@pshaughn pshaughn force-pushed the pshaughn:taintfile branch from 38b1e54 to 41d896c Feb 11, 2020
@jdm
Copy link
Member

jdm commented Feb 11, 2020

@bors-servo
Copy link
Contributor

bors-servo commented Feb 11, 2020

📌 Commit 41d896c has been approved by jdm

bors-servo added a commit that referenced this pull request Feb 11, 2020
Filter file: and about: responses opaquely

<!-- Please describe your changes on the following line: -->
file: and about: schemes were being treated like data: for cors purposes, when in fact they should have been subject to opaque response filtering. A comment indicated that this was necessary for some CSS tests, but I think the comment was out of date; the only tests depending on the unfiltered responses are unit tests that do not test any CSS functionality. I've updated those tests to now test for the opaque-filtering itself.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #25686

<!-- Either: -->
- [X] There are tests for these changes, but also some loss of unit test coverage (#25693) and a newly failing test case (#25692)

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
@bors-servo
Copy link
Contributor

bors-servo commented Feb 11, 2020

Testing commit 41d896c with merge 0defcce...

@bors-servo
Copy link
Contributor

bors-servo commented Feb 11, 2020

💔 Test failed - status-taskcluster

@pshaughn
Copy link
Member Author

pshaughn commented Feb 11, 2020

I haven't seen those before, but I can't think of any way an OfflineAudioContext would be trying to open a file: or about: url so they're probably unrelated?

@jdm
Copy link
Member

jdm commented Feb 11, 2020

@bors-servo retry

Indeed!

@bors-servo
Copy link
Contributor

bors-servo commented Feb 11, 2020

Testing commit 41d896c with merge ba23c5a...

bors-servo added a commit that referenced this pull request Feb 11, 2020
Filter file: and about: responses opaquely

<!-- Please describe your changes on the following line: -->
file: and about: schemes were being treated like data: for cors purposes, when in fact they should have been subject to opaque response filtering. A comment indicated that this was necessary for some CSS tests, but I think the comment was out of date; the only tests depending on the unfiltered responses are unit tests that do not test any CSS functionality. I've updated those tests to now test for the opaque-filtering itself.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #25686

<!-- Either: -->
- [X] There are tests for these changes, but also some loss of unit test coverage (#25693) and a newly failing test case (#25692)

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
@bors-servo
Copy link
Contributor

bors-servo commented Feb 11, 2020

☀️ Test successful - status-taskcluster
Approved by: jdm
Pushing ba23c5a to master...

@bors-servo bors-servo merged commit 41d896c into servo:master Feb 11, 2020
2 checks passed
2 checks passed
Community-TC (pull_request) TaskGroup: success
Details
homu Test successful
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

4 participants
You can’t perform that action at this time.