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

Unified Diff: net/cookies/canonical_cookie.cc

Issue 2633663003: Implements strict secure cookies as the default behavior in //net (Closed)
Patch Set: Rebase on ToT 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 | « net/cookies/canonical_cookie.h ('k') | net/cookies/canonical_cookie_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cookies/canonical_cookie.cc
diff --git a/net/cookies/canonical_cookie.cc b/net/cookies/canonical_cookie.cc
index de2fbbe6c65f03826722b05646936e95ad0ae536..2b53e4ee497fa4ed7e3fa6652afd0e8221e53b16 100644
--- a/net/cookies/canonical_cookie.cc
+++ b/net/cookies/canonical_cookie.cc
@@ -195,8 +195,7 @@ std::unique_ptr<CanonicalCookie> CanonicalCookie::Create(
// origins", if the cookie's "secure-only-flag" is "true" and the requesting
// URL does not have a secure scheme, the cookie should be thrown away.
// https://tools.ietf.org/html/draft-ietf-httpbis-cookie-alone
- if (options.enforce_strict_secure() && parsed_cookie.IsSecure() &&
- !url.SchemeIsCryptographic()) {
+ if (parsed_cookie.IsSecure() && !url.SchemeIsCryptographic()) {
VLOG(kVlogSetCookies)
<< "Create() is trying to create a secure cookie from an insecure URL";
return nullptr;
@@ -240,7 +239,6 @@ std::unique_ptr<CanonicalCookie> CanonicalCookie::Create(
bool secure,
bool http_only,
CookieSameSite same_site,
- bool enforce_strict_secure,
CookiePriority priority) {
// Expect valid attribute tokens and values, as defined by the ParsedCookie
// logic, otherwise don't create the cookie.
@@ -260,7 +258,7 @@ std::unique_ptr<CanonicalCookie> CanonicalCookie::Create(
return nullptr;
}
- if (enforce_strict_secure && secure && !url.SchemeIsCryptographic())
+ if (secure && !url.SchemeIsCryptographic())
return nullptr;
std::string parsed_path = ParsedCookie::ParseValueString(path);
« no previous file with comments | « net/cookies/canonical_cookie.h ('k') | net/cookies/canonical_cookie_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698