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

Make HTTP redirect fetch return an error if redirecting to non-HTTP(S) #14069

Closed
jdm opened this issue Nov 4, 2016 · 7 comments
Closed

Make HTTP redirect fetch return an error if redirecting to non-HTTP(S) #14069

jdm opened this issue Nov 4, 2016 · 7 comments
Labels

Comments

@jdm
Copy link
Member

@jdm jdm commented Nov 4, 2016

Step 4 of the http redirect fetch specification says that we should return an error if we try to redirect to a non-HTTP(S) URL. Our corresponding implementation has a TODO in http_redirect_fetch. We should check the scheme of location_url and return Response::network_error if it doesn't match.

Code: components/net/fetch/methods.rs
Test:
./mach test-wpt tests/wpt/web-platform-tests/fetch/api/redirect/redirect-schemes.html should pass after this change. We should remove the test expectation file in that case.

@jdm jdm added this to the Swiss Hackathon milestone Nov 4, 2016
@jdm jdm added the A-network label Nov 4, 2016
@rschlaefli
Copy link

@rschlaefli rschlaefli commented Nov 5, 2016

I would like to try this as part of the hackathon :)

@jdm jdm added the C-assigned label Nov 5, 2016
@jdm
Copy link
Member Author

@jdm jdm commented Nov 5, 2016

Great! Please ask questions if anything is unclear! The testing situation might be complicated until #14070 merges.

@rschlaefli
Copy link

@rschlaefli rschlaefli commented Nov 5, 2016

I think I solved it but I'm getting timeouts and "not run" in the test suite. Might this be because of the other issue?

@jdm
Copy link
Member Author

@jdm jdm commented Nov 5, 2016

Probably! Try applying the changes in that PR and see if the test results make more sense?

@jdm
Copy link
Member Author

@jdm jdm commented Nov 15, 2016

@rschlaefli Want to make a pull request with your changes?

@jdm jdm added E-easy and removed C-assigned labels Nov 29, 2016
@highfive
Copy link

@highfive highfive commented Nov 29, 2016

Please make a comment here if you intend to work on this issue. Thank you!

@jdm jdm removed this from the Swiss Hackathon milestone Nov 29, 2016
46bit added a commit to 46bit/servo that referenced this issue Nov 30, 2016
46bit added a commit to 46bit/servo that referenced this issue Nov 30, 2016
@46bit
Copy link
Contributor

@46bit 46bit commented Nov 30, 2016

Hi, I just found Servo. It looks like this is up-for-grabs so I've made the patch above.

46bit added a commit to 46bit/servo that referenced this issue Nov 30, 2016
bors-servo added a commit that referenced this issue Nov 30, 2016
Made http_redirect_fetch error for non-HTTPS. #14069

Hi! I'm a newbie looking to resolve #14069.

The [existing tests](https://dxr.mozilla.org/servo/source/tests/wpt/web-platform-tests/fetch/api/redirect/redirect-schemes.html) now pass.

Cheers!

---
<!-- 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 #14069 (github issue number if applicable).

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

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

<!-- 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/14420)
<!-- Reviewable:end -->
bors-servo added a commit that referenced this issue Nov 30, 2016
Made http_redirect_fetch error for non-HTTPS. #14069

Hi! I'm a newbie looking to resolve #14069.

The [existing tests](https://dxr.mozilla.org/servo/source/tests/wpt/web-platform-tests/fetch/api/redirect/redirect-schemes.html) now pass.

Cheers!

---
<!-- 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 #14069 (github issue number if applicable).

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

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

<!-- 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/14420)
<!-- Reviewable:end -->
46bit added a commit to 46bit/servo that referenced this issue Nov 30, 2016
bors-servo added a commit that referenced this issue Dec 1, 2016
Made http_redirect_fetch error for non-HTTPS. #14069

Hi! I'm a newbie looking to resolve #14069.

The [existing tests](https://dxr.mozilla.org/servo/source/tests/wpt/web-platform-tests/fetch/api/redirect/redirect-schemes.html) now pass.

Cheers!

---
<!-- 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 #14069 (github issue number if applicable).

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

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

<!-- 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/14420)
<!-- Reviewable:end -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

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