Index: Source/core/loader/DocumentThreadableLoader.cpp |
diff --git a/Source/core/loader/DocumentThreadableLoader.cpp b/Source/core/loader/DocumentThreadableLoader.cpp |
index bcb00b9b67766a00380e91cad3274af94fc719e0..f6c73b3ba4cc732729baf9908bf545cfe3a6e984 100644 |
--- a/Source/core/loader/DocumentThreadableLoader.cpp |
+++ b/Source/core/loader/DocumentThreadableLoader.cpp |
@@ -111,13 +111,15 @@ void DocumentThreadableLoader::makeCrossOriginAccessRequest(const ResourceReques |
{ |
ASSERT(m_options.crossOriginRequestPolicy == UseAccessControl); |
- if ((m_options.preflightPolicy == ConsiderPreflight && isSimpleCrossOriginAccessRequest(request.httpMethod(), request.httpHeaderFields())) || m_options.preflightPolicy == PreventPreflight) { |
- // Cross-origin requests are only allowed for HTTP and registered schemes. We would catch this when checking response headers later, but there is no reason to send a request that's guaranteed to be denied. |
- if (!SchemeRegistry::shouldTreatURLSchemeAsCORSEnabled(request.url().protocol())) { |
- m_client->didFailAccessControlCheck(ResourceError(errorDomainBlinkInternal, 0, request.url().string(), "Cross origin requests are only supported for HTTP.")); |
- return; |
- } |
+ // Cross-origin requests are only allowed for HTTP and registered schemes. |
+ // We would catch this when checking response headers later, but there is no reason to |
+ // send a request, preflighted or not, that's guaranteed to be denied. |
+ if (!SchemeRegistry::shouldTreatURLSchemeAsCORSEnabled(request.url().protocol())) { |
+ m_client->didFailAccessControlCheck(ResourceError(errorDomainBlinkInternal, 0, request.url().string(), "Cross origin requests are only supported for HTTP.")); |
abarth-chromium
2014/07/14 00:59:45
This message doesn't seem entirely correct. Can w
sof
2014/07/14 07:03:26
Certainly, it would help to be accurate. Doesn't i
|
+ return; |
+ } |
+ if ((m_options.preflightPolicy == ConsiderPreflight && isSimpleCrossOriginAccessRequest(request.httpMethod(), request.httpHeaderFields())) || m_options.preflightPolicy == PreventPreflight) { |
ResourceRequest crossOriginRequest(request); |
ResourceLoaderOptions crossOriginOptions(m_resourceLoaderOptions); |
updateRequestForAccessControl(crossOriginRequest, securityOrigin(), effectiveAllowCredentials()); |