Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upUpdating http_network_or_cache_fetch to better match the fetch API spec #14784
Conversation
highfive
commented
Dec 30, 2016
|
Heads up! This PR modifies the following files:
|
highfive
commented
Dec 30, 2016
|
@bors-servo try |
Updating http_network_or_cache_fetch to better match the fetch API spec <!-- Please describe your changes on the following line: --> --- <!-- 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 - [ ] These changes fix #14742 <!-- Either: --> - [x] There are tests for these changes <!-- 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/14784) <!-- Reviewable:end -->
|
|
Looking good! You'll need to update the WPT test expectations. |
| type: testharness | ||
| [Microtask immediately after script] | ||
| expected: FAIL | ||
|
|
This comment has been minimized.
This comment has been minimized.
jdm
Dec 30, 2016
Member
Unfortunately this isn't actually a result caused by these changes (see #14221), so we should revert this.
|
I have made the updates. |
|
This looks fine with some indentation adjustments. |
| if response.is_none() { | ||
| if http_request.cache_mode.get() == CacheMode::OnlyIfCached { | ||
| return Response::network_error(NetworkError::Internal("Couldn't find response in cache".into())) |
This comment has been minimized.
This comment has been minimized.
| http_request.cache_mode.get() == CacheMode::NoCache) { | ||
| match status { | ||
| StatusCode::NotModified => { | ||
| // Step 21 |
This comment has been minimized.
This comment has been minimized.
| StatusCode::NotModified => { | ||
| // Step 21 | ||
| if http_request.cache_mode.get() == CacheMode::Default || | ||
| http_request.cache_mode.get() == CacheMode::NoCache { | ||
| // Substep 1 |
This comment has been minimized.
This comment has been minimized.
| } | ||
| }, | ||
| StatusCode::Unauthorized => { | ||
| // Step 22 |
This comment has been minimized.
This comment has been minimized.
| return http_network_or_cache_fetch(http_request, true, cors_flag, done_chan, context); | ||
| }, | ||
| StatusCode::ProxyAuthenticationRequired => { | ||
| // Step 23 |
This comment has been minimized.
This comment has been minimized.
| // Step 20 | ||
| // Step 24 | ||
| if authentication_fetch_flag { | ||
| // TODO Create the authentication entry for request and the given realm |
This comment has been minimized.
This comment has been minimized.
|
I have made the updates. |
|
Almost there! Still needs some indentation changes, and after that it can be r=me. |
| let fetch_result = http_network_or_cache_fetch(request.clone(), credentials, authentication_fetch_flag, | ||
| done_chan, context); | ||
| let fetch_result = http_network_or_cache_fetch(request.clone(), authentication_fetch_flag, | ||
| cors_flag, done_chan, context); |
This comment has been minimized.
This comment has been minimized.
| // TODO have a HTTP cache to check for a completed response | ||
| let complete_http_response_from_cache: Option<Response> = None; | ||
| if http_request.cache_mode.get() != CacheMode::NoStore && | ||
| http_request.cache_mode.get() != CacheMode::Reload && | ||
| complete_http_response_from_cache.is_some() { | ||
| // Substep 1 | ||
| if http_request.cache_mode.get() == CacheMode::ForceCache { | ||
| if http_request.cache_mode.get() == CacheMode::ForceCache || | ||
| http_request.cache_mode.get() == CacheMode::OnlyIfCached { |
This comment has been minimized.
This comment has been minimized.
|
I have made the updates. |
|
@bors-servo r=KiChjang,jdm |
|
|
Updating http_network_or_cache_fetch to better match the fetch API spec <!-- Please describe your changes on the following line: --> --- <!-- 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 #14742 <!-- Either: --> - [x] There are tests for these changes <!-- 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/14784) <!-- Reviewable:end -->
|
|
|
|
I have fixed that line. |
|
@bors-servo: r=jdm,KiChjang |
|
|
Updating http_network_or_cache_fetch to better match the fetch API spec <!-- Please describe your changes on the following line: --> --- <!-- 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 #14742 <!-- Either: --> - [x] There are tests for these changes <!-- 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/14784) <!-- Reviewable:end -->
|
|
|
@bors-servo: retry |
|
|
|
|
mattnenterprise commentedDec 30, 2016
•
edited
./mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThis change is