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

Unified Diff: third_party/WebKit/Source/core/fetch/CrossOriginAccessControlTest.cpp

Issue 2633423003: Leave out empty-valued Access-Control-Request-Headers: on preflights. (Closed)
Patch Set: explicitly include safe headers in the (test) request Created 3 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 | « third_party/WebKit/Source/core/fetch/CrossOriginAccessControl.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/fetch/CrossOriginAccessControlTest.cpp
diff --git a/third_party/WebKit/Source/core/fetch/CrossOriginAccessControlTest.cpp b/third_party/WebKit/Source/core/fetch/CrossOriginAccessControlTest.cpp
index 744bd0f4332ba71861e82b554ab1e27f6577c0d1..9ce090060c52b38fd310750cb354875576e9a110 100644
--- a/third_party/WebKit/Source/core/fetch/CrossOriginAccessControlTest.cpp
+++ b/third_party/WebKit/Source/core/fetch/CrossOriginAccessControlTest.cpp
@@ -48,7 +48,11 @@ TEST_F(CreateAccessControlPreflightRequestTest, ExcludeSimpleHeaders) {
ResourceRequest preflight =
createAccessControlPreflightRequest(request, m_securityOrigin.get());
- EXPECT_EQ("", preflight.httpHeaderField("Access-Control-Request-Headers"));
+ // Do not emit empty-valued headers; an empty list of non-"CORS safelisted"
+ // request headers should cause "Access-Control-Request-Headers:" to be
+ // left out in the preflight request.
+ EXPECT_EQ(nullAtom,
+ preflight.httpHeaderField("Access-Control-Request-Headers"));
}
TEST_F(CreateAccessControlPreflightRequestTest,
@@ -59,7 +63,9 @@ TEST_F(CreateAccessControlPreflightRequestTest,
ResourceRequest preflight =
createAccessControlPreflightRequest(request, m_securityOrigin.get());
- EXPECT_EQ("", preflight.httpHeaderField("Access-Control-Request-Headers"));
+ // Empty list also; see comment in test above.
+ EXPECT_EQ(nullAtom,
+ preflight.httpHeaderField("Access-Control-Request-Headers"));
}
TEST_F(CreateAccessControlPreflightRequestTest, IncludeNonSimpleHeader) {
« no previous file with comments | « third_party/WebKit/Source/core/fetch/CrossOriginAccessControl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698