mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Assert that domain_match
is operating on lowercase text
> (Note that both the domain string and the string will have been > canonicalized to lower case at this point.) Related to #15789
This commit is contained in:
parent
0dbee36915
commit
b0499e3422
1 changed files with 2 additions and 0 deletions
|
@ -139,6 +139,8 @@ impl Cookie {
|
|||
|
||||
// http://tools.ietf.org/html/rfc6265#section-5.1.3
|
||||
pub fn domain_match(string: &str, domain_string: &str) -> bool {
|
||||
debug_assert!(string.to_lowercase() == string);
|
||||
debug_assert!(domain_string.to_lowercase() == domain_string);
|
||||
string == domain_string ||
|
||||
(string.ends_with(domain_string) &&
|
||||
string.as_bytes()[string.len()-domain_string.len()-1] == b'.' &&
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue