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

Unified Diff: Source/core/loader/CrossOriginPreflightResultCache.cpp

Issue 1196423003: Improve console log message for CORS failure (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 5 years, 6 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: Source/core/loader/CrossOriginPreflightResultCache.cpp
diff --git a/Source/core/loader/CrossOriginPreflightResultCache.cpp b/Source/core/loader/CrossOriginPreflightResultCache.cpp
index 2dab9c461346cc980d5c711066c82f90ce4514d1..2671d8f5325895ff8d1b4f38fe2cba69d9490bbf 100644
--- a/Source/core/loader/CrossOriginPreflightResultCache.cpp
+++ b/Source/core/loader/CrossOriginPreflightResultCache.cpp
@@ -89,13 +89,13 @@ bool CrossOriginPreflightResultCacheItem::parse(const ResourceResponse& response
{
m_methods.clear();
if (!parseAccessControlAllowList(response.httpHeaderField("Access-Control-Allow-Methods"), m_methods)) {
- errorDescription = "Cannot parse Access-Control-Allow-Methods response header field.";
+ errorDescription = "Cannot parse Access-Control-Allow-Methods response header field in preflight response.";
return false;
}
m_headers.clear();
if (!parseAccessControlAllowList(response.httpHeaderField("Access-Control-Allow-Headers"), m_headers)) {
- errorDescription = "Cannot parse Access-Control-Allow-Headers response header field.";
+ errorDescription = "Cannot parse Access-Control-Allow-Headers response header field in preflight response.";
return false;
}
@@ -116,7 +116,7 @@ bool CrossOriginPreflightResultCacheItem::allowsCrossOriginMethod(const String&
if (m_methods.contains(method) || FetchUtils::isSimpleMethod(method))
return true;
- errorDescription = "Method " + method + " is not allowed by Access-Control-Allow-Methods.";
+ errorDescription = "Method " + method + " is not allowed by Access-Control-Allow-Methods in preflight response.";
return false;
}
@@ -124,7 +124,7 @@ bool CrossOriginPreflightResultCacheItem::allowsCrossOriginHeaders(const HTTPHea
{
for (const auto& header : requestHeaders) {
if (!m_headers.contains(header.key) && !FetchUtils::isSimpleHeader(header.key, header.value) && !FetchUtils::isForbiddenHeaderName(header.key)) {
- errorDescription = "Request header field " + header.key.string() + " is not allowed by Access-Control-Allow-Headers.";
+ errorDescription = "Request header field " + header.key.string() + " is not allowed by Access-Control-Allow-Headers in preflight response.";
return false;
}
}

Powered by Google App Engine
This is Rietveld 408576698