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

Implementation of HTTP Redirect Fetch step #9608

Merged
merged 1 commit into from Feb 18, 2016

Conversation

@nikkisquared
Copy link
Contributor

nikkisquared commented Feb 11, 2016

I've made a first draft of a complete implementation of HTTP Redirect Fetch, most of which is just refactored out of HTTP Fetch. I've also made some minor changes in a few other steps, all collected in the second commit, based on recent changes to the Fetch Standard. Since HTTP Redirect Fetch is so new, I figured now would be a fine time to make those other changes.

The biggest thing on my mind right now is how the spec says[1] "This algorithm will be used by HTML's "navigate" algorithm in addition to HTTP fetch above." This makes me think that this function, as well as HTTP Fetch, need to public, or at least have a public-facing function- since each Fetch function takes an Rc, which might be weird to require callers to supply.

[1] https://fetch.spec.whatwg.org/#http-redirect-fetch

Review on Reviewable

@highfive
Copy link

highfive commented Feb 11, 2016

warning Warning warning

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

jdm commented Feb 11, 2016

Good work! Only a few small things that need further work.
-S-awaiting-review +S-needs-code-changes


Reviewed 1 of 1 files at r1, 1 of 1 files at r2, 1 of 1 files at r3, 2 of 2 files at r4.
Review status: all files reviewed at latest revision, 3 unresolved discussions.


components/net/fetch/methods.rs, line 438 [r1] (raw file):
We can do response = request.redirect_mode.get() { and simplify the cases a bit by removing the assignment from them.


components/net/fetch/methods.rs, line 570 [r1] (raw file):
This would be easier to read as:

let status_code = actual_response.status.unwrap();
if ((status_code == ... ||

components/net/fetch/methods.rs, line 571 [r4] (raw file):
This match doesn't actually match the spec text. We should have a test for this behaviour :D


Comments from the review on Reviewable.io

@jdm
Copy link
Member

jdm commented Feb 17, 2016

Great work! Go ahead and squash these together!
-S-awaiting-review +S-needs-squash


Reviewed 2 of 2 files at r5.
Review status: all files reviewed at latest revision, all discussions resolved.


Comments from the review on Reviewable.io

@nikkisquared nikkisquared force-pushed the nikkisquared:implement_http_redirect_fetch branch from deced34 to cf60760 Feb 17, 2016
@jdm
Copy link
Member

jdm commented Feb 17, 2016

@bors-servo
Copy link
Contributor

bors-servo commented Feb 17, 2016

📌 Commit cf60760 has been approved by jdm

@bors-servo
Copy link
Contributor

bors-servo commented Feb 17, 2016

Testing commit cf60760 with merge 4bcd740...

bors-servo added a commit that referenced this pull request Feb 17, 2016
Implementation of HTTP Redirect Fetch step

I've made a first draft of a complete implementation of HTTP Redirect Fetch, most of which is just refactored out of HTTP Fetch. I've also made some minor changes in a few other steps, all collected in the second commit, based on recent changes to the Fetch Standard. Since HTTP Redirect Fetch is so new, I figured now would be a fine time to make those other changes.

The biggest thing on my mind right now is how the spec says[1] "This algorithm will be used by HTML's "navigate" algorithm in addition to HTTP fetch above." This makes me think that this function, as well as HTTP Fetch, need to public, or at least have a public-facing function- since each Fetch function takes an Rc<Request>, which might be weird to require callers to supply.

[1] https://fetch.spec.whatwg.org/#http-redirect-fetch

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9608)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Feb 17, 2016

💔 Test failed - linux-rel

@jdm
Copy link
Member

jdm commented Feb 17, 2016

@bors-servo
Copy link
Contributor

bors-servo commented Feb 17, 2016

Testing commit cf60760 with merge c46aac8...

bors-servo added a commit that referenced this pull request Feb 17, 2016
Implementation of HTTP Redirect Fetch step

I've made a first draft of a complete implementation of HTTP Redirect Fetch, most of which is just refactored out of HTTP Fetch. I've also made some minor changes in a few other steps, all collected in the second commit, based on recent changes to the Fetch Standard. Since HTTP Redirect Fetch is so new, I figured now would be a fine time to make those other changes.

The biggest thing on my mind right now is how the spec says[1] "This algorithm will be used by HTML's "navigate" algorithm in addition to HTTP fetch above." This makes me think that this function, as well as HTTP Fetch, need to public, or at least have a public-facing function- since each Fetch function takes an Rc<Request>, which might be weird to require callers to supply.

[1] https://fetch.spec.whatwg.org/#http-redirect-fetch

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9608)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Feb 17, 2016

💔 Test failed - mac-rel-css

@larsbergstrom
Copy link
Contributor

larsbergstrom commented Feb 18, 2016

@bors-servo
Copy link
Contributor

bors-servo commented Feb 18, 2016

Testing commit cf60760 with merge 88afe38...

bors-servo added a commit that referenced this pull request Feb 18, 2016
Implementation of HTTP Redirect Fetch step

I've made a first draft of a complete implementation of HTTP Redirect Fetch, most of which is just refactored out of HTTP Fetch. I've also made some minor changes in a few other steps, all collected in the second commit, based on recent changes to the Fetch Standard. Since HTTP Redirect Fetch is so new, I figured now would be a fine time to make those other changes.

The biggest thing on my mind right now is how the spec says[1] "This algorithm will be used by HTML's "navigate" algorithm in addition to HTTP fetch above." This makes me think that this function, as well as HTTP Fetch, need to public, or at least have a public-facing function- since each Fetch function takes an Rc<Request>, which might be weird to require callers to supply.

[1] https://fetch.spec.whatwg.org/#http-redirect-fetch

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9608)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Feb 18, 2016

@bors-servo bors-servo merged commit cf60760 into servo:master Feb 18, 2016
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
@nikkisquared nikkisquared deleted the nikkisquared:implement_http_redirect_fetch branch Feb 18, 2016
@jdm jdm removed the S-awaiting-merge label May 8, 2017
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.

None yet

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