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

Unified Diff: net/http/http_security_headers_unittest.cc

Issue 2895373002: Do not require Expect-CT report-uris to be quoted (Closed)
Patch Set: Created 3 years, 7 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 | « net/http/http_security_headers.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_security_headers_unittest.cc
diff --git a/net/http/http_security_headers_unittest.cc b/net/http/http_security_headers_unittest.cc
index 5cfbd551a1e42bfafb1664746393e1110e33291b..e87c9fb9a073d344716ea6376b58568da24266c0 100644
--- a/net/http/http_security_headers_unittest.cc
+++ b/net/http/http_security_headers_unittest.cc
@@ -994,8 +994,6 @@ TEST_F(HttpSecurityHeadersTest, BogusExpectCTHeaders) {
&max_age, &enforce, &report_uri));
EXPECT_FALSE(ParseExpectCTHeader("max-age=999, report-uri=\"foo;bar\"",
&max_age, &enforce, &report_uri));
- EXPECT_FALSE(ParseExpectCTHeader("max-age=999, report-uri=http://blah",
- &max_age, &enforce, &report_uri));
EXPECT_FALSE(ParseExpectCTHeader("max-age=999, report-uri=\"\"", &max_age,
&enforce, &report_uri));
@@ -1085,6 +1083,15 @@ TEST_F(HttpSecurityHeadersTest, ValidExpectCTHeaders) {
EXPECT_TRUE(enforce);
EXPECT_EQ(GURL("https://foo.test"), report_uri);
+ enforce = false;
+ report_uri = GURL();
+ EXPECT_TRUE(
+ ParseExpectCTHeader("enforce,report-uri=https://foo.test,max-age=123",
+ &max_age, &enforce, &report_uri));
+ EXPECT_EQ(base::TimeDelta::FromSeconds(123), max_age);
+ EXPECT_TRUE(enforce);
+ EXPECT_EQ(GURL("https://foo.test"), report_uri);
+
report_uri = GURL();
enforce = false;
EXPECT_TRUE(ParseExpectCTHeader("report-uri=\"https://foo.test\",max-age=123",
« no previous file with comments | « net/http/http_security_headers.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698