diff options
author | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-22 19:10:17 +0000 |
---|---|---|
committer | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-22 19:10:17 +0000 |
commit | a7497876755f9fc2845a6226b7f7840550117e7f (patch) | |
tree | ee5b1202af5fd9b3c8be537125e03f1753f34229 /net | |
parent | 87930be9c2f649026664778f132b2a003984d489 (diff) | |
download | chromium_src-a7497876755f9fc2845a6226b7f7840550117e7f.zip chromium_src-a7497876755f9fc2845a6226b7f7840550117e7f.tar.gz chromium_src-a7497876755f9fc2845a6226b7f7840550117e7f.tar.bz2 |
Mark a cookie as session cookie, if the expiry date cannot be parsed
BUG=104813
TEST=CookieManagerTest.InvalidExpiryTime
Review URL: http://codereview.chromium.org/8473010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111188 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r-- | net/base/cookie_monster.cc | 2 | ||||
-rw-r--r-- | net/base/cookie_monster_unittest.cc | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/net/base/cookie_monster.cc b/net/base/cookie_monster.cc index 7274cec..03061c6 100644 --- a/net/base/cookie_monster.cc +++ b/net/base/cookie_monster.cc @@ -2631,7 +2631,7 @@ CookieMonster::CanonicalCookie* CookieMonster::CanonicalCookie::Create( return (Create(url, pc.Name(), pc.Value(), domain_string, path_string, mac_key, mac_algorithm, creation_time, expiration_time, - pc.IsSecure(), pc.IsHttpOnly(), pc.HasExpires())); + pc.IsSecure(), pc.IsHttpOnly(), !expiration_time.is_null())); } CookieMonster::CanonicalCookie* CookieMonster::CanonicalCookie::Create( diff --git a/net/base/cookie_monster_unittest.cc b/net/base/cookie_monster_unittest.cc index 5e2db5b..ce8d9ae 100644 --- a/net/base/cookie_monster_unittest.cc +++ b/net/base/cookie_monster_unittest.cc @@ -3570,4 +3570,13 @@ TEST_F(CookieMonsterTest, ShortLivedSessionCookies) { EXPECT_EQ(0U, cookies.size()); } +TEST_F(CookieMonsterTest, InvalidExpiryTime) { + CookieMonster::ParsedCookie pc( + std::string(kValidCookieLine) + "; expires=Blarg arg arg"); + scoped_ptr<CookieMonster::CanonicalCookie> cookie( + CookieMonster::CanonicalCookie::Create(url_google_, pc)); + + ASSERT_FALSE(cookie->DoesExpire()); +} + } // namespace net |