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

Unified Diff: third_party/WebKit/Source/core/loader/ImageLoader.cpp

Issue 1487343002: Set credentials mode "same-origin" when crossOrigin=anonymous is set. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years 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
Index: third_party/WebKit/Source/core/loader/ImageLoader.cpp
diff --git a/third_party/WebKit/Source/core/loader/ImageLoader.cpp b/third_party/WebKit/Source/core/loader/ImageLoader.cpp
index 102b2edca18aa195d2e59370600868912301ddda..d4bc457b51dc50410eebcb531a00bb0d5514cf85 100644
--- a/third_party/WebKit/Source/core/loader/ImageLoader.cpp
+++ b/third_party/WebKit/Source/core/loader/ImageLoader.cpp
@@ -38,6 +38,7 @@
#include "core/frame/LocalFrame.h"
#include "core/frame/Settings.h"
#include "core/frame/UseCounter.h"
+#include "core/html/CrossOriginAttribute.h"
#include "core/html/HTMLImageElement.h"
#include "core/html/parser/HTMLParserIdioms.h"
#include "core/layout/LayoutImage.h"
@@ -253,9 +254,9 @@ static void configureRequest(FetchRequest& request, ImageLoader::BypassMainWorld
if (bypassBehavior == ImageLoader::BypassMainWorldCSP)
request.setContentSecurityCheck(DoNotCheckContentSecurityPolicy);
- AtomicString crossOriginMode = element.fastGetAttribute(HTMLNames::crossoriginAttr);
- if (!crossOriginMode.isNull())
- request.setCrossOriginAccessControl(element.document().securityOrigin(), crossOriginMode);
+ CrossOriginAttributeValue crossOrigin = crossOriginAttributeValue(element.fastGetAttribute(HTMLNames::crossoriginAttr));
+ if (crossOrigin != CrossOriginAttributeNotSet)
+ request.setCrossOriginAccessControl(element.document().securityOrigin(), crossOrigin);
if (clientHintsPreferences.shouldSendResourceWidth() && isHTMLImageElement(element))
request.setResourceWidth(toHTMLImageElement(element).resourceWidth());
« no previous file with comments | « third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp ('k') | third_party/WebKit/Source/core/loader/LinkLoader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698