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; |