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

Unified Diff: Source/core/fetch/CrossOriginAccessControl.cpp

Issue 1300083002: Add suggestion to use "no-cors" with Fetch fails CORS check. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Patch CORS error expectation files to include message about Fetch CORS. Created 5 years, 4 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 | « LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-unsafe-redirect-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/fetch/CrossOriginAccessControl.cpp
diff --git a/Source/core/fetch/CrossOriginAccessControl.cpp b/Source/core/fetch/CrossOriginAccessControl.cpp
index facfe26710166dfc10dc6b3ed726201528625284..b9a5c1350070ff4dfb01d7812b8ce532f068d8ef 100644
--- a/Source/core/fetch/CrossOriginAccessControl.cpp
+++ b/Source/core/fetch/CrossOriginAccessControl.cpp
@@ -158,6 +158,8 @@ bool passesAccessControlCheck(const ResourceResponse& response, StoredCredential
if (isInterestingStatusCode(statusCode))
errorDescription.append(" The response had HTTP status code " + String::number(statusCode) + ".");
+ errorDescription.append(" Alternatively, if you want an opaque response, switch to The Fetch API in 'no-cors' mode.");
hiroshige 2015/08/28 08:24:23 nit: s/The Fetch API/the Fetch API/
+
return false;
}
@@ -172,6 +174,7 @@ bool passesAccessControlCheck(const ResourceResponse& response, StoredCredential
detail = "The 'Access-Control-Allow-Origin' header has a value '" + allowOriginHeaderValue + "' that is not equal to the supplied origin.";
}
errorDescription = buildAccessControlFailureMessage(detail, securityOrigin);
+ errorDescription.append(" Either change the header, or, if you want an opaque response, use the Fetch API in 'no-cors' mode.");
return false;
}
« no previous file with comments | « LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-unsafe-redirect-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698