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

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

Issue 110273006: Show better CORS error message when status code is not set (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed tests Created 6 years, 11 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 | « no previous file | Source/web/tests/AssociatedURLLoaderTest.cpp » ('j') | 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 33a60d0ae78ebceab697275e4e97fdd959c3f6ff..d2a87bf2abb80e348a9c74a42f1098733e7c9d46 100644
--- a/Source/core/fetch/CrossOriginAccessControl.cpp
+++ b/Source/core/fetch/CrossOriginAccessControl.cpp
@@ -143,6 +143,11 @@ bool passesAccessControlCheck(const ResourceResponse& response, StoredCredential
AtomicallyInitializedStatic(AtomicString&, accessControlAllowOrigin = *new AtomicString("access-control-allow-origin", AtomicString::ConstructFromLiteral));
AtomicallyInitializedStatic(AtomicString&, accessControlAllowCredentials = *new AtomicString("access-control-allow-credentials", AtomicString::ConstructFromLiteral));
+ if (!response.httpStatusCode()) {
+ errorDescription = "Received an invalid response. Origin '" + securityOrigin->toString() + "' is therefore not allowed access.";
+ return false;
+ }
+
// A wildcard Access-Control-Allow-Origin can not be used if credentials are to be sent,
// even with Access-Control-Allow-Credentials set to true.
const AtomicString& accessControlOriginString = response.httpHeaderField(accessControlAllowOrigin);
« no previous file with comments | « no previous file | Source/web/tests/AssociatedURLLoaderTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698