mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
fix: cookies filter secure invalid (#37246)
* fix: cookies filter secure and session invalid Co-authored-by: Black-Hole1 <158blackhole@gmail.com> * test: add test Co-authored-by: Black-Hole1 <158blackhole@gmail.com> * test: fix test failed Co-authored-by: Black-Hole1 <158blackhole@gmail.com> * test: fix test failed again Co-authored-by: Black-Hole1 <158blackhole@gmail.com> * fix: session check logic incorrect Co-authored-by: Black-Hole1 <158blackhole@gmail.com> * refactor: reset cookies filter session logic Co-authored-by: Black-Hole1 <158blackhole@gmail.com> * Update shell/browser/api/electron_api_cookies.cc Co-authored-by: Robo <hop2deep@gmail.com> Co-authored-by: Black-Hole <158blackhole@gmail.com> * chore: re-enable worker spec failures (#37015) Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> --------- Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Black-Hole1 <158blackhole@gmail.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
@@ -128,10 +128,10 @@ bool MatchesCookie(const base::Value::Dict& filter,
|
||||
!MatchesDomain(*str, cookie.Domain()))
|
||||
return false;
|
||||
absl::optional<bool> secure_filter = filter.FindBool("secure");
|
||||
if (secure_filter && *secure_filter == cookie.IsSecure())
|
||||
if (secure_filter && *secure_filter != cookie.IsSecure())
|
||||
return false;
|
||||
absl::optional<bool> session_filter = filter.FindBool("session");
|
||||
if (session_filter && *session_filter != !cookie.IsPersistent())
|
||||
if (session_filter && *session_filter == cookie.IsPersistent())
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user