зеркало из https://github.com/mozilla/pjs.git
Bug 667490 - EventSource should use the same nsIContentPolicy type as XHR, r=dveditz
This commit is contained in:
Родитель
603f7fd435
Коммит
dc322a3cd5
|
@ -112,9 +112,10 @@ interface nsIContentPolicy : nsISupports
|
|||
const unsigned long TYPE_PING = 10;
|
||||
|
||||
/**
|
||||
* Indicates an XMLHttpRequest. Also used for document.load.
|
||||
* Indicates an XMLHttpRequest. Also used for document.load and for EventSource.
|
||||
*/
|
||||
const unsigned long TYPE_XMLHTTPREQUEST = 11;
|
||||
const unsigned long TYPE_DATAREQUEST = 11; // alias
|
||||
|
||||
/**
|
||||
* Indicates a request by a plugin.
|
||||
|
|
|
@ -872,7 +872,7 @@ nsEventSource::InitChannelAndRequestEventSource()
|
|||
if (csp) {
|
||||
channelPolicy = do_CreateInstance("@mozilla.org/nschannelpolicy;1");
|
||||
channelPolicy->SetContentSecurityPolicy(csp);
|
||||
channelPolicy->SetLoadType(nsIContentPolicy::TYPE_SCRIPT);
|
||||
channelPolicy->SetLoadType(nsIContentPolicy::TYPE_DATAREQUEST);
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIChannel> channel;
|
||||
|
@ -1203,7 +1203,7 @@ nsEventSource::CheckCanRequestSrc(nsIURI* aSrc)
|
|||
rv = CheckInnerWindowCorrectness();
|
||||
NS_ENSURE_SUCCESS(rv, false);
|
||||
PRInt16 shouldLoad = nsIContentPolicy::ACCEPT;
|
||||
rv = NS_CheckContentLoadPolicy(nsIContentPolicy::TYPE_SCRIPT,
|
||||
rv = NS_CheckContentLoadPolicy(nsIContentPolicy::TYPE_DATAREQUEST,
|
||||
srcToTest,
|
||||
mPrincipal,
|
||||
doc,
|
||||
|
|
Загрузка…
Ссылка в новой задаче