Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(35)

Unified Diff: third_party/WebKit/Source/core/fetch/ScriptResource.cpp

Issue 1713093002: Fix SRI bypass by loading same resource twice in same origin. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@2623
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/fetch/ScriptResource.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/fetch/ScriptResource.cpp
diff --git a/third_party/WebKit/Source/core/fetch/ScriptResource.cpp b/third_party/WebKit/Source/core/fetch/ScriptResource.cpp
index 686d4ac4b55ba0abace1d1225a85881083ec4603..74756eb8a952a3f160d823170449efd1b87b177b 100644
--- a/third_party/WebKit/Source/core/fetch/ScriptResource.cpp
+++ b/third_party/WebKit/Source/core/fetch/ScriptResource.cpp
@@ -48,7 +48,7 @@ ResourcePtr<ScriptResource> ScriptResource::fetch(FetchRequest& request, Resourc
}
ScriptResource::ScriptResource(const ResourceRequest& resourceRequest, const String& charset)
- : TextResource(resourceRequest, Script, "application/javascript", charset), m_integrityChecked(false)
+ : TextResource(resourceRequest, Script, "application/javascript", charset), m_integrityDisposition(ScriptIntegrityDisposition::NotChecked)
{
DEFINE_STATIC_LOCAL(const AtomicString, acceptScript, ("*/*", AtomicString::ConstructFromLiteral));
@@ -118,6 +118,11 @@ bool ScriptResource::mimeTypeAllowedByNosniff() const
return parseContentTypeOptionsHeader(m_response.httpHeaderField(HTTPNames::X_Content_Type_Options)) != ContentTypeOptionsNosniff || MIMETypeRegistry::isSupportedJavaScriptMIMEType(mimeType());
}
+void ScriptResource::setIntegrityDisposition(ScriptIntegrityDisposition disposition)
+{
+ ASSERT(disposition != ScriptIntegrityDisposition::NotChecked);
+ m_integrityDisposition = disposition;
+}
bool ScriptResource::mustRefetchDueToIntegrityMetadata(const FetchRequest& request) const
{
if (request.integrityMetadata().isEmpty())
« no previous file with comments | « third_party/WebKit/Source/core/fetch/ScriptResource.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698