Skip to content

Commit

Permalink
fixup! Bug #15502. Isolate blob, mediasource & mediastream URLs to fi…
Browse files Browse the repository at this point in the history
…rst party
  • Loading branch information
arthuredelstein committed May 20, 2016
1 parent f5c58c8 commit 94fa4b0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions dom/base/nsXMLHttpRequest.cpp
Expand Up @@ -1697,8 +1697,13 @@ nsXMLHttpRequest::Open(const nsACString& inMethod, const nsACString& url,

// If we have the document, use it. Unfortunately, for dedicated workers
// 'doc' ends up being the parent document, which is not the document
// that we want to use. So make sure to avoid using 'doc' in that situation.
if (doc && doc->NodePrincipal() == mPrincipal) {
// that we want to use because it has the wrong Content Security Policy.
// So make sure to avoid using 'doc' in that situation.
// However, for blob urls, we don't care about CSP but we do need to
// pass on the parent document to get the correct first party.
bool isBlob = false;
if (doc && (doc->NodePrincipal() == mPrincipal ||
(NS_SUCCEEDED(uri->SchemeIs("blob", &isBlob)) && isBlob))) {
rv = NS_NewChannel(getter_AddRefs(mChannel),
uri,
doc,
Expand Down

0 comments on commit 94fa4b0

Please sign in to comment.