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

Don't filter the bodies of cross-origin cached responses #22340

Merged
merged 1 commit into from Dec 1, 2018

Conversation

Projects
None yet
6 participants
@jdm
Member

jdm commented Dec 1, 2018

There are a few issues at play in #22330:

  • loading https://servo.org followed by http://servo.org retrieves the second response from the cache (since http://servo.org is upgraded due to HSTS)
  • since the request URL differs from the request origin, the response is filtered according to the rules of CORS
  • since the response body is already present, there's no async response channel to wait on in wait_for_response
  • a filtered response stores an empty response, while the real response sits inside the inner response

The effect of this combination was that the constellation's fetch listener would receive the response headers, followed immediately by a response EOF. That is no longer the case, since wait_for_response correctly transfers the underlying response body to the network listener.


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #22330

This change is Reviewable

@highfive

This comment has been minimized.

highfive commented Dec 1, 2018

Heads up! This PR modifies the following files:

@highfive

This comment has been minimized.

highfive commented Dec 1, 2018

warning Warning warning

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

This comment has been minimized.

Member

jdm commented Dec 1, 2018

@bors-servo try=wpt

@bors-servo

This comment has been minimized.

Contributor

bors-servo commented Dec 1, 2018

⌛️ Trying commit 0d9ab89 with merge 050ec50...

bors-servo added a commit that referenced this pull request Dec 1, 2018

Auto merge of #22340 - jdm:reload, r=<try>
Don't filter the bodies of cross-origin cached responses

There are a few issues at play in #22330:
* loading https://servo.org followed by http://servo.org retrieves the second response from the cache (since http://servo.org is upgraded due to HSTS)
* since the request URL differs from the request origin, the response is filtered according to the rules of CORS
* since the response body is already present, there's no async response channel to wait on in `wait_for_response`
* a filtered response stores an empty response, while the real response sits inside the inner response

The effect of this combination was that the constellation's fetch listener would receive the response headers, followed immediately by a response EOF. That is no longer the case, since `wait_for_response` correctly transfers the underlying response body to the network listener.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #22330

<!-- 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/22340)
<!-- Reviewable:end -->
@bors-servo

This comment has been minimized.

Contributor

bors-servo commented Dec 1, 2018

☀️ Test successful - linux-rel-css, linux-rel-wpt
State: approved= try=True

@KiChjang

This comment has been minimized.

Member

KiChjang commented Dec 1, 2018

@bors-servo

This comment has been minimized.

Contributor

bors-servo commented Dec 1, 2018

📌 Commit 0d9ab89 has been approved by KiChjang

@highfive highfive assigned KiChjang and unassigned nox Dec 1, 2018

@bors-servo

This comment has been minimized.

Contributor

bors-servo commented Dec 1, 2018

⌛️ Testing commit 0d9ab89 with merge 362a0d5...

bors-servo added a commit that referenced this pull request Dec 1, 2018

Auto merge of #22340 - jdm:reload, r=KiChjang
Don't filter the bodies of cross-origin cached responses

There are a few issues at play in #22330:
* loading https://servo.org followed by http://servo.org retrieves the second response from the cache (since http://servo.org is upgraded due to HSTS)
* since the request URL differs from the request origin, the response is filtered according to the rules of CORS
* since the response body is already present, there's no async response channel to wait on in `wait_for_response`
* a filtered response stores an empty response, while the real response sits inside the inner response

The effect of this combination was that the constellation's fetch listener would receive the response headers, followed immediately by a response EOF. That is no longer the case, since `wait_for_response` correctly transfers the underlying response body to the network listener.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #22330

<!-- 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/22340)
<!-- Reviewable:end -->
@bors-servo

This comment has been minimized.

Contributor

bors-servo commented Dec 1, 2018

💔 Test failed - linux-rel-css

@Darkspirit

This comment has been minimized.

Contributor

Darkspirit commented Dec 1, 2018

Same error here. Please retry.

@jdm

This comment has been minimized.

Member

jdm commented Dec 1, 2018

@bors-servo

This comment has been minimized.

Contributor

bors-servo commented Dec 1, 2018

@bors-servo

This comment has been minimized.

@bors-servo bors-servo merged commit 0d9ab89 into servo:master Dec 1, 2018

3 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment