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

De-deplicate is_cors_safelisted_request_header helper functions #25236

Merged
merged 1 commit into from Dec 17, 2019

Conversation

@pshaughn
Copy link
Member

pshaughn commented Dec 10, 2019

Separate is_cors_safelisted_request_header implementations in script::dom::request and net::fetch::methods have been merged to a single implementation in net_traits::request, with additional logic for spec requirements that weren't previously there. This doesn't pass all the failing tests, but it doesn't fail any passing ones either and it reduces confusion about what's supposed to happen where.


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #25235 and some but not all subcases in #25175
  • There are tests for these changes, in that the WPT CORS tests that did already pass still do
@highfive
Copy link

highfive commented Dec 10, 2019

Heads up! This PR modifies the following files:

  • @asajeffrey: components/script/dom/request.rs, components/script/dom/headers.rs
  • @KiChjang: components/script/dom/request.rs, components/net/fetch/methods.rs, components/script/dom/headers.rs, components/net_traits/request.rs, components/net/http_loader.rs
@highfive
Copy link

highfive commented Dec 10, 2019

warning Warning warning

  • These commits modify net and script code, but no tests are modified. Please consider adding a test!
@jdm jdm changed the title Now just one fn is_cors_safelisted_request_header De-deplicate is_cors_safelisted_request_header helper functions Dec 13, 2019
@jdm
Copy link
Member

jdm commented Dec 13, 2019

@bors-servo
Copy link
Contributor

bors-servo commented Dec 13, 2019

📌 Commit 3272cfb has been approved by jdm

@bors-servo
Copy link
Contributor

bors-servo commented Dec 13, 2019

Testing commit 3272cfb with merge 3b9131a...

bors-servo added a commit that referenced this pull request Dec 13, 2019
De-deplicate is_cors_safelisted_request_header helper functions

<!-- Please describe your changes on the following line: -->
Separate is_cors_safelisted_request_header implementations in script::dom::request and net::fetch::methods have been merged to a single implementation in net_traits::request, with additional logic for spec requirements that weren't previously there. This doesn't seem to pass any failing tests, but it doesn't fail any passing ones either and it reduces confusion about what's supposed to happen where.

---
<!-- 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 #25235

<!-- Either: -->
- [X] There are tests for these changes, in that the WPT CORS tests that did already pass still do

<!-- 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 Dec 13, 2019

💔 Test failed - status-taskcluster

@pshaughn
Copy link
Member Author

pshaughn commented Dec 14, 2019

It turns out this did pass a few failing tests I hadn't tried, and after seeing that I looked back at the spec, saw a rule I missed, and made it pass more of them. I think everything else that went wrong in that test run was intermittents of some sort, but I stand to be proven wrong.

Don't retry yet! There's one more rule I overlooked.

@jdm
Copy link
Member

jdm commented Dec 14, 2019

Yes, there were a bunch of known intermittent failures in the non-cors test results.

@CYBAI
Copy link
Collaborator

CYBAI commented Dec 16, 2019

Diff in /repo/components/net_traits/request.rs at line 554:
 ) -> bool {
     let name: &str = name.as_ref();
     let value: &[u8] = value.as_ref();
-    if value.len()>128 { return false; }
�(B+    if value.len() > 128 {
�(B+        return false;
�(B+    }
�(B     match name {
         "accept" => is_cors_safelisted_request_accept(value),
         "accept-language" | "content-language" => is_cors_safelisted_language(value),
clang-format not installed. Skipping CPP formatting.
Run `./mach fmt` to fix the formatting
@pshaughn pshaughn force-pushed the pshaughn:safelistct branch from 1ac3909 to 3028799 Dec 16, 2019
@pshaughn
Copy link
Member Author

pshaughn commented Dec 16, 2019

Ready to retry; there are still some failing cases but I think I've gotten as far as I can on this without needing changes to how we use the hyper HeaderMap itself.

@jdm
Copy link
Member

jdm commented Dec 16, 2019

@bors-servo try=wpt

@bors-servo
Copy link
Contributor

bors-servo commented Dec 16, 2019

Trying commit 3028799 with merge 4b636d6...

bors-servo added a commit that referenced this pull request Dec 16, 2019
De-deplicate is_cors_safelisted_request_header helper functions

<!-- Please describe your changes on the following line: -->
Separate is_cors_safelisted_request_header implementations in script::dom::request and net::fetch::methods have been merged to a single implementation in net_traits::request, with additional logic for spec requirements that weren't previously there. This doesn't pass all the failing tests, but it doesn't fail any passing ones either and it reduces confusion about what's supposed to happen where.

---
<!-- 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 #25235 and some but not all subcases in #25175

<!-- Either: -->
- [X] There are tests for these changes, in that the WPT CORS tests that did already pass still do

<!-- 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. -->
@pshaughn pshaughn force-pushed the pshaughn:safelistct branch from 3028799 to 67827de Dec 16, 2019
@jdm
Copy link
Member

jdm commented Dec 16, 2019

@bors-servo
Copy link
Contributor

bors-servo commented Dec 16, 2019

📌 Commit 67827de has been approved by jdm

@bors-servo
Copy link
Contributor

bors-servo commented Dec 16, 2019

Testing commit 67827de with merge e7697b3...

@bors-servo
Copy link
Contributor

bors-servo commented Dec 16, 2019

💔 Test failed - status-taskcluster

@jdm
Copy link
Member

jdm commented Dec 16, 2019

@bors-servo
Copy link
Contributor

bors-servo commented Dec 16, 2019

Testing commit 67827de with merge 3586a7f...

bors-servo added a commit that referenced this pull request Dec 16, 2019
De-deplicate is_cors_safelisted_request_header helper functions

<!-- Please describe your changes on the following line: -->
Separate is_cors_safelisted_request_header implementations in script::dom::request and net::fetch::methods have been merged to a single implementation in net_traits::request, with additional logic for spec requirements that weren't previously there. This doesn't pass all the failing tests, but it doesn't fail any passing ones either and it reduces confusion about what's supposed to happen where.

---
<!-- 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 #25235 and some but not all subcases in #25175

<!-- Either: -->
- [X] There are tests for these changes, in that the WPT CORS tests that did already pass still do

<!-- 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 Dec 16, 2019

💔 Test failed - status-taskcluster

@jdm
Copy link
Member

jdm commented Dec 16, 2019

@bors-servo
Copy link
Contributor

bors-servo commented Dec 17, 2019

Testing commit 67827de with merge 64e90b0...

bors-servo added a commit that referenced this pull request Dec 17, 2019
De-deplicate is_cors_safelisted_request_header helper functions

<!-- Please describe your changes on the following line: -->
Separate is_cors_safelisted_request_header implementations in script::dom::request and net::fetch::methods have been merged to a single implementation in net_traits::request, with additional logic for spec requirements that weren't previously there. This doesn't pass all the failing tests, but it doesn't fail any passing ones either and it reduces confusion about what's supposed to happen where.

---
<!-- 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 #25235 and some but not all subcases in #25175

<!-- Either: -->
- [X] There are tests for these changes, in that the WPT CORS tests that did already pass still do

<!-- 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 Dec 17, 2019

💔 Test failed - status-taskcluster

@jdm
Copy link
Member

jdm commented Dec 17, 2019

@bors-servo retry

@bors-servo
Copy link
Contributor

bors-servo commented Dec 17, 2019

Testing commit 67827de with merge b274d59...

bors-servo added a commit that referenced this pull request Dec 17, 2019
De-deplicate is_cors_safelisted_request_header helper functions

<!-- Please describe your changes on the following line: -->
Separate is_cors_safelisted_request_header implementations in script::dom::request and net::fetch::methods have been merged to a single implementation in net_traits::request, with additional logic for spec requirements that weren't previously there. This doesn't pass all the failing tests, but it doesn't fail any passing ones either and it reduces confusion about what's supposed to happen where.

---
<!-- 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 #25235 and some but not all subcases in #25175

<!-- Either: -->
- [X] There are tests for these changes, in that the WPT CORS tests that did already pass still do

<!-- 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 Dec 17, 2019

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

@bors-servo bors-servo merged commit 67827de into servo:master Dec 17, 2019
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.

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