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

Unified Diff: net/http/http_util_unittest.cc

Issue 2225933004: Avoid adding invalid headers in AddHeaderFromString (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 4 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_util.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_util_unittest.cc
diff --git a/net/http/http_util_unittest.cc b/net/http/http_util_unittest.cc
index 94fde662aabef821d41cdf4f6a350a30bed783c6..4a1257deb697e6a49866338129b320bb84ab0819 100644
--- a/net/http/http_util_unittest.cc
+++ b/net/http/http_util_unittest.cc
@@ -1392,4 +1392,11 @@ TEST(HttpUtilTest, IsValidHeaderValue) {
EXPECT_TRUE(HttpUtil::IsValidHeaderValue(allowed));
}
+TEST(HttpUtilTest, IsToken) {
+ EXPECT_TRUE(HttpUtil::IsToken("valid"));
+ EXPECT_FALSE(HttpUtil::IsToken(""));
+ EXPECT_FALSE(HttpUtil::IsToken(base::StringPiece()));
+ EXPECT_FALSE(HttpUtil::IsToken("hello, world"));
+}
+
} // namespace net
« no previous file with comments | « net/http/http_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698