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

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

Issue 1801513003: Cross origin requests to same origin should match Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed failing CORS tests Created 4 years, 9 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
Index: third_party/WebKit/Source/core/loader/TextTrackLoader.cpp
diff --git a/third_party/WebKit/Source/core/loader/TextTrackLoader.cpp b/third_party/WebKit/Source/core/loader/TextTrackLoader.cpp
index c7461a1f9ae2b901d9f2325e9a4a8aca9a974237..34b0dcf33378ad4e09bbdd4eeec728b1929fa744 100644
--- a/third_party/WebKit/Source/core/loader/TextTrackLoader.cpp
+++ b/third_party/WebKit/Source/core/loader/TextTrackLoader.cpp
@@ -109,13 +109,12 @@ bool TextTrackLoader::load(const KURL& url, CrossOriginAttributeValue crossOrigi
FetchRequest cueRequest(ResourceRequest(document().completeURL(url)), FetchInitiatorTypeNames::texttrack);
- if (crossOrigin != CrossOriginAttributeNotSet) {
- cueRequest.setCrossOriginAccessControl(document().getSecurityOrigin(), crossOrigin);
- } else if (!document().getSecurityOrigin()->canRequestNoSuborigin(url)) {
+ if (crossOrigin == CrossOriginAttributeNotSet && !document().getSecurityOrigin()->canRequestNoSuborigin(url)) {
// Text track elements without 'crossorigin' set on the parent are "No CORS"; report error if not same-origin.
corsPolicyPreventedLoad(document().getSecurityOrigin(), url);
return false;
}
+ cueRequest.setCrossOriginAccessControl(document().getSecurityOrigin(), crossOrigin);
ResourceFetcher* fetcher = document().fetcher();
setResource(RawResource::fetchTextTrack(cueRequest, fetcher));

Powered by Google App Engine
This is Rietveld 408576698