aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/fetch.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2019-04-25 20:21:23 -0400
committerGitHub <noreply@github.com>2019-04-25 20:21:23 -0400
commitb73956cc371d2b1bc0c82823b11e7777bb69ad6b (patch)
tree39bc135931e30af5b14e6fa6343a014d2d24c44f /components/script/fetch.rs
parent880f3b8b7a34b48449c372238b32333fe1f1cc4f (diff)
parent2440e0f98ade12cf595fe7c791a1065b29b53d74 (diff)
downloadservo-b73956cc371d2b1bc0c82823b11e7777bb69ad6b.tar.gz
servo-b73956cc371d2b1bc0c82823b11e7777bb69ad6b.zip
Auto merge of #23090 - miller-time:nav-fetch-referrer, r=gterzian
Add referrer to navigation fetch request <!-- Please describe your changes on the following line: --> Implement step 13 of [following hyperlinks](https://html.spec.whatwg.org/#following-hyperlinks-2) and step 14.3 of [window open](https://html.spec.whatwg.org/#window-open-steps), as well as other referrer- and fetch-related updates. --- <!-- 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 #22890 (GitHub issue number if applicable) <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because ___ <!-- 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. --> <!-- 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/23090) <!-- Reviewable:end -->
Diffstat (limited to 'components/script/fetch.rs')
-rw-r--r--components/script/fetch.rs6
1 files changed, 1 insertions, 5 deletions
diff --git a/components/script/fetch.rs b/components/script/fetch.rs
index a95fbb7437d..01708d5c532 100644
--- a/components/script/fetch.rs
+++ b/components/script/fetch.rs
@@ -94,10 +94,6 @@ impl Drop for FetchCanceller {
}
}
-fn from_referrer_to_referrer_url(request: &NetTraitsRequest) -> Option<ServoUrl> {
- request.referrer.to_url().map(|url| url.clone())
-}
-
fn request_init_from_request(request: NetTraitsRequest) -> RequestBuilder {
RequestBuilder {
method: request.method.clone(),
@@ -118,7 +114,7 @@ fn request_init_from_request(request: NetTraitsRequest) -> RequestBuilder {
.origin()
.immutable()
.clone(),
- referrer_url: from_referrer_to_referrer_url(&request),
+ referrer: Some(request.referrer.clone()),
referrer_policy: request.referrer_policy,
pipeline_id: request.pipeline_id,
redirect_mode: request.redirect_mode,