mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Refactor to use ServoUrl::is_secure_scheme
This commit is contained in:
parent
9123fe0cef
commit
49abf57deb
1 changed files with 2 additions and 2 deletions
|
@ -38,7 +38,7 @@ impl CookieStorage {
|
||||||
let cookies = self.cookies_map.entry(domain).or_insert(vec![]);
|
let cookies = self.cookies_map.entry(domain).or_insert(vec![]);
|
||||||
|
|
||||||
// https://www.ietf.org/id/draft-ietf-httpbis-cookie-alone-01.txt Step 2
|
// https://www.ietf.org/id/draft-ietf-httpbis-cookie-alone-01.txt Step 2
|
||||||
if !cookie.cookie.secure && url.scheme() != "https" && url.scheme() != "wss" {
|
if !cookie.cookie.secure && !url.is_secure_scheme() {
|
||||||
let new_domain = cookie.cookie.domain.as_ref().unwrap();
|
let new_domain = cookie.cookie.domain.as_ref().unwrap();
|
||||||
let new_path = cookie.cookie.path.as_ref().unwrap();
|
let new_path = cookie.cookie.path.as_ref().unwrap();
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@ impl CookieStorage {
|
||||||
// http://tools.ietf.org/html/rfc6265#section-5.3
|
// http://tools.ietf.org/html/rfc6265#section-5.3
|
||||||
pub fn push(&mut self, mut cookie: Cookie, url: &ServoUrl, source: CookieSource) {
|
pub fn push(&mut self, mut cookie: Cookie, url: &ServoUrl, source: CookieSource) {
|
||||||
// https://www.ietf.org/id/draft-ietf-httpbis-cookie-alone-01.txt Step 1
|
// https://www.ietf.org/id/draft-ietf-httpbis-cookie-alone-01.txt Step 1
|
||||||
if cookie.cookie.secure && url.scheme() != "https" && url.scheme() != "wss" {
|
if cookie.cookie.secure && !url.is_secure_scheme() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue