Index: third_party/WebKit/Source/core/fetch/CrossOriginAccessControl.cpp |
diff --git a/third_party/WebKit/Source/core/fetch/CrossOriginAccessControl.cpp b/third_party/WebKit/Source/core/fetch/CrossOriginAccessControl.cpp |
index 2e8c98ac2ed9b288e0eb1e83285c9cf87c8de604..ff43d8812f29a747f37b100e4e7763b396c61127 100644 |
--- a/third_party/WebKit/Source/core/fetch/CrossOriginAccessControl.cpp |
+++ b/third_party/WebKit/Source/core/fetch/CrossOriginAccessControl.cpp |
@@ -70,6 +70,8 @@ static AtomicString createAccessControlRequestHeadersHeader( |
} |
filteredHeaders.push_back(header.key.lower()); |
} |
+ if (!filteredHeaders.size()) |
+ return nullAtom; |
// Sort header names lexicographically. |
std::sort(filteredHeaders.begin(), filteredHeaders.end(), |
@@ -106,10 +108,11 @@ ResourceRequest createAccessControlPreflightRequest( |
HTTPNames::Access_Control_Request_External, "true"); |
} |
- if (request.httpHeaderFields().size() > 0) { |
+ AtomicString requestHeaders = |
+ createAccessControlRequestHeadersHeader(request.httpHeaderFields()); |
+ if (requestHeaders != nullAtom) { |
preflightRequest.setHTTPHeaderField( |
- HTTPNames::Access_Control_Request_Headers, |
- createAccessControlRequestHeadersHeader(request.httpHeaderFields())); |
+ HTTPNames::Access_Control_Request_Headers, requestHeaders); |
} |
return preflightRequest; |