Skip to content

Commit cfcf429

Browse files
authored
url version bump to get bad\\:hostname WPT fix (#66)
1 parent 734ad04 commit cfcf429

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ repository = "https://github.com/denoland/rust-urlpattern"
88
license = "MIT"
99

1010
[dependencies]
11-
url = "2.4.1"
11+
url = "2.5.6"
1212
regex = "1.10.5"
1313
serde = { version = "1.0.127", features = ["derive"] }
1414
unic-ucd-ident = { version = "0.9.0", features = ["id"] }

src/testdata/urlpatterntestdata.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2474,7 +2474,6 @@
24742474
}
24752475
},
24762476
{
2477-
"skip": "likely a bug in rust-url",
24782477
"pattern": [{ "hostname": "bad\\:hostname" }],
24792478
"expected_obj": "error"
24802479
},

src/tokenizer.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,14 @@ pub fn tokenize(
160160
);
161161
continue;
162162
}
163+
if tokenizer.code_point == Some('\n')
164+
|| tokenizer.code_point == Some('\r')
165+
|| tokenizer.code_point == Some('\t')
166+
{
167+
// ignore newline, carriage return and tab
168+
tokenizer.index = tokenizer.next_index;
169+
continue;
170+
}
163171
if tokenizer.code_point == Some('{') {
164172
tokenizer.add_token_with_default_pos_and_len(TokenType::Open);
165173
continue;

0 commit comments

Comments
 (0)