зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1160458 - Part 1: Use the CSP of the principal passed to CreateServiceWorker. r=nsm
--HG-- extra : transplant_source : %5D%12%AE%F1%22%FAx%02g%D1C%3E%F7h%DB%AF%5C%A7PY
This commit is contained in:
Родитель
616f08b31b
Коммит
8e93c3cd23
|
@ -3580,6 +3580,24 @@ ServiceWorkerManager::CreateServiceWorker(nsIPrincipal* aPrincipal,
|
|||
info.mIndexedDBAllowed =
|
||||
indexedDB::IDBFactory::AllowedForPrincipal(aPrincipal);
|
||||
|
||||
nsCOMPtr<nsIContentSecurityPolicy> csp;
|
||||
rv = aPrincipal->GetCsp(getter_AddRefs(csp));
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
info.mCSP = csp;
|
||||
if (info.mCSP) {
|
||||
rv = info.mCSP->GetAllowsEval(&info.mReportCSPViolations,
|
||||
&info.mEvalAllowed);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
}
|
||||
} else {
|
||||
info.mEvalAllowed = true;
|
||||
info.mReportCSPViolations = false;
|
||||
}
|
||||
|
||||
// NOTE: this defaults the SW load context to:
|
||||
// - private browsing = false
|
||||
// - content = true
|
||||
|
|
Загрузка…
Ссылка в новой задаче