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

Unified Diff: net/base/cookie_monster_unittest.cc

Issue 18657: Support domain=IPADDR if it matches the url ip address exactly. (Closed)
Patch Set: Created 11 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 | « net/base/cookie_monster.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/cookie_monster_unittest.cc
diff --git a/net/base/cookie_monster_unittest.cc b/net/base/cookie_monster_unittest.cc
index 1d5d9636133e595972cba215a120af87da0ba6bd..48843d10089a1a93753fd607a555f3a947893943 100644
--- a/net/base/cookie_monster_unittest.cc
+++ b/net/base/cookie_monster_unittest.cc
@@ -406,6 +406,12 @@ TEST(CookieMonsterTest, TestIpAddress) {
EXPECT_FALSE(cm.SetCookie(url_ip, "b=2; domain=.1.2.3.4"));
EXPECT_FALSE(cm.SetCookie(url_ip, "c=3; domain=.3.4"));
EXPECT_EQ("", cm.GetCookies(url_ip));
+ // It should be allowed to set a cookie if domain= matches the IP address
+ // exactly. This matches IE/Firefox, even though it seems a bit wrong.
+ EXPECT_FALSE(cm.SetCookie(url_ip, "b=2; domain=1.2.3.3"));
+ EXPECT_EQ("", cm.GetCookies(url_ip));
+ EXPECT_TRUE(cm.SetCookie(url_ip, "b=2; domain=1.2.3.4"));
+ EXPECT_EQ("b=2", cm.GetCookies(url_ip));
}
}
« no previous file with comments | « net/base/cookie_monster.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698