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

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

Issue 21532002: CORS: Handle error HTTP status code 4XX/5XX in preflight requests. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 5 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 | « Source/core/loader/CrossOriginAccessControl.h ('k') | Source/core/loader/DocumentThreadableLoader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/loader/CrossOriginAccessControl.cpp
diff --git a/Source/core/loader/CrossOriginAccessControl.cpp b/Source/core/loader/CrossOriginAccessControl.cpp
index 1c8cb1ca153bcfa04a2c3109df58db6412f64d49..6c4fbf0f83c9a0c9ae222715cc4deb62bee4ec30 100644
--- a/Source/core/loader/CrossOriginAccessControl.cpp
+++ b/Source/core/loader/CrossOriginAccessControl.cpp
@@ -166,6 +166,16 @@ bool passesAccessControlCheck(const ResourceResponse& response, StoredCredential
return true;
}
+bool passesPreflightStatusCheck(const ResourceResponse& response, String& errorDescription)
+{
+ if (response.httpStatusCode() < 200 || response.httpStatusCode() >= 400) {
+ errorDescription = "Invalid HTTP status code " + String::number(response.httpStatusCode());
+ return false;
+ }
+
+ return true;
+}
+
void parseAccessControlExposeHeadersAllowList(const String& headerValue, HTTPHeaderSet& headerSet)
{
Vector<String> headers;
« no previous file with comments | « Source/core/loader/CrossOriginAccessControl.h ('k') | Source/core/loader/DocumentThreadableLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698