Auto merge of #23887 - servo:jdm-patch-47, r=asajeffrey

Use origin of final HTTP response as document origin

I discovered surprising problems when loading pages from http://joshmatthews.net that load same-origin images and try to use them as webgl textures. Since there's a redirect from joshmatthews.net to www.joshmatthews.net, the images are not considered same-origin in Servo because the document stores the origin for the original request's URL, rather than the origin of the response that is received after processing any redirections.

<!-- 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/23887)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2019-07-29 23:20:53 -04:00 committed by GitHub
commit 73784246b8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 73 additions and 2 deletions

View file

@ -3128,7 +3128,7 @@ impl ScriptThread {
incomplete.pipeline_id,
incomplete.parent_info,
incomplete.window_size,
origin,
origin.clone(),
incomplete.navigation_start,
incomplete.navigation_start_precise,
self.webgl_chan.as_ref().map(|chan| chan.channel()),
@ -3212,7 +3212,7 @@ impl ScriptThread {
&window,
HasBrowsingContext::Yes,
Some(final_url.clone()),
incomplete.origin,
origin,
is_html_document,
content_type,
last_modified,