Bug 604496. Inherit the document principal for data: media elements. r=cpearce
This commit is contained in:
@@ -1202,12 +1202,21 @@ nsresult HTMLMediaElement::LoadResource()
|
||||
return FinishDecoderSetup(decoder, resource, nullptr, nullptr);
|
||||
}
|
||||
|
||||
nsSecurityFlags securityFlags = nsILoadInfo::SEC_NORMAL;
|
||||
if (nsContentUtils::ChannelShouldInheritPrincipal(NodePrincipal(),
|
||||
mLoadingSrc,
|
||||
false, // aInheritForAboutBlank
|
||||
false // aForceInherit
|
||||
)) {
|
||||
securityFlags = nsILoadInfo::SEC_FORCE_INHERIT_PRINCIPAL;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsILoadGroup> loadGroup = GetDocumentLoadGroup();
|
||||
nsCOMPtr<nsIChannel> channel;
|
||||
rv = NS_NewChannel(getter_AddRefs(channel),
|
||||
mLoadingSrc,
|
||||
static_cast<Element*>(this),
|
||||
nsILoadInfo::SEC_NORMAL,
|
||||
securityFlags,
|
||||
nsIContentPolicy::TYPE_MEDIA,
|
||||
loadGroup,
|
||||
nullptr, // aCallbacks
|
||||
|
||||
Reference in New Issue
Block a user