| Index: Source/core/workers/WorkerScriptLoader.cpp
|
| diff --git a/Source/core/workers/WorkerScriptLoader.cpp b/Source/core/workers/WorkerScriptLoader.cpp
|
| index e86eeb591801230324d0096444ffbb2c2b29d942..7b30539fe2394cef581fe5adb8c8152f918f0853 100644
|
| --- a/Source/core/workers/WorkerScriptLoader.cpp
|
| +++ b/Source/core/workers/WorkerScriptLoader.cpp
|
| @@ -33,6 +33,7 @@
|
| #include "core/loader/WorkerThreadableLoader.h"
|
| #include "core/workers/WorkerGlobalScope.h"
|
| #include "core/workers/WorkerScriptLoaderClient.h"
|
| +#include "platform/network/ContentSecurityPolicyResponseHeaders.h"
|
| #include "platform/network/ResourceResponse.h"
|
| #include "public/platform/WebURLRequest.h"
|
|
|
| @@ -119,6 +120,7 @@ void WorkerScriptLoader::didReceiveResponse(unsigned long identifier, const Reso
|
| }
|
| m_responseURL = response.url();
|
| m_responseEncoding = response.textEncodingName();
|
| + processContentSecurityPolicy(response);
|
| if (m_client)
|
| m_client->didReceiveResponse(identifier, response);
|
| }
|
| @@ -197,4 +199,13 @@ void WorkerScriptLoader::notifyFinished()
|
| m_client->notifyFinished();
|
| }
|
|
|
| +void WorkerScriptLoader::processContentSecurityPolicy(const ResourceResponse& response)
|
| +{
|
| + if (!response.url().protocolIs("blob") && !response.url().protocolIs("file") && !response.url().protocolIs("filesystem")) {
|
| + m_contentSecurityPolicy = ContentSecurityPolicy::create();
|
| + m_contentSecurityPolicy->setOverrideURLForSelf(response.url());
|
| + m_contentSecurityPolicy->didReceiveHeaders(ContentSecurityPolicyResponseHeaders(response));
|
| + }
|
| +}
|
| +
|
| } // namespace blink
|
|
|