Skip to content

Commit a706400

Browse files
committed
Fix file:#frag test case
1 parent edee129 commit a706400

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/parser.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,7 @@ impl<'a> Parser<'a> {
451451
let scheme_end = "file".len() as u32;
452452
let path_start = "file://".len() as u32;
453453
let fragment_start = "file:///".len() as u32;
454+
self.serialization.push('#');
454455
self.parse_fragment(input_after_first_char);
455456
Ok(Url {
456457
serialization: self.serialization,

tests/urltestdata.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5371,6 +5371,20 @@
53715371
"search": "?q=v",
53725372
"hash": ""
53735373
},
5374+
{
5375+
"input": "file:#frag",
5376+
"base": "about:blank",
5377+
"href": "file:///#frag",
5378+
"protocol": "file:",
5379+
"username": "",
5380+
"password": "",
5381+
"host": "",
5382+
"hostname": "",
5383+
"port": "",
5384+
"pathname": "/",
5385+
"search": "",
5386+
"hash": "#frag"
5387+
},
53745388
"# IPv6 tests",
53755389
{
53765390
"input": "http://[1:0::]",

0 commit comments

Comments
 (0)