File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -1723,6 +1723,19 @@ impl Url {
1723
1723
) ;
1724
1724
}
1725
1725
} ) ;
1726
+
1727
+ // To handle cases like <non-spec:/> set pathname to </.//p>
1728
+ // For instance, //p should be converted to /.//p here
1729
+ if let Some ( pos) = self . serialization . rfind ( "//" ) {
1730
+ let rest = & self . serialization [ ( pos + 2 ) ..] ;
1731
+
1732
+ const PATH_INCREMENT : u32 = 2 ; // length of "/."
1733
+ if rest. len ( ) == 1 {
1734
+ self . serialization . replace_range ( pos.., & format ! ( "/.//{}" , rest) ) ;
1735
+ self . path_start += PATH_INCREMENT ;
1736
+ }
1737
+ }
1738
+
1726
1739
self . restore_after_path ( old_after_path_pos, & after_path) ;
1727
1740
}
1728
1741
Original file line number Diff line number Diff line change 44
44
<file://monkey/> set pathname to <\\\\>
45
45
<file:///unicorn> set pathname to <//\\/>
46
46
<file:///unicorn> set pathname to <//monkey/..//>
47
- <non-spec:/> set pathname to </.//p>
48
- <non-spec:/> set pathname to </..//p>
49
- <non-spec:/> set pathname to <//p>
50
47
<non-spec:/.//> set pathname to <p>
You can’t perform that action at this time.
0 commit comments