mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Auto merge of #8752 - Manishearth:om-nom, r=metajack
Make `path_matches` match the spec (fixes cookies) <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8752) <!-- Reviewable:end -->
This commit is contained in:
commit
595bda478e
2 changed files with 31 additions and 3 deletions
|
@ -25,6 +25,23 @@ fn test_domain_match() {
|
|||
assert!(!Cookie::domain_match("235.132.2.3", ".2.3"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_path_match() {
|
||||
assert!(Cookie::path_match("/", "/"));
|
||||
assert!(Cookie::path_match("/index.html", "/"));
|
||||
assert!(Cookie::path_match("/w/index.html", "/"));
|
||||
assert!(Cookie::path_match("/w/index.html", "/w/index.html"));
|
||||
assert!(Cookie::path_match("/w/index.html", "/w/"));
|
||||
assert!(Cookie::path_match("/w/index.html", "/w"));
|
||||
|
||||
assert!(!Cookie::path_match("/", "/w/"));
|
||||
assert!(!Cookie::path_match("/a", "/w/"));
|
||||
assert!(!Cookie::path_match("/", "/w"));
|
||||
assert!(!Cookie::path_match("/w/index.html", "/w/index"));
|
||||
assert!(!Cookie::path_match("/windex.html", "/w/"));
|
||||
assert!(!Cookie::path_match("/windex.html", "/w"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_default_path() {
|
||||
assert!(&*Cookie::default_path("/foo/bar/baz/") == "/foo/bar/baz");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue