File tree Expand file tree Collapse file tree 3 files changed +21
-2
lines changed Expand file tree Collapse file tree 3 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -865,6 +865,19 @@ function update(url, params) {
865865 ctx . search = '?' + serializedParams ;
866866 } else {
867867 ctx . search = '' ;
868+
869+ // Potentially strip trailing spaces from an opaque path
870+ if ( ctx . hasOpaquePath && ctx . hash . length === 0 ) {
871+ let length = ctx . pathname . length ;
872+ while ( length > 0 && ctx . pathname . charCodeAt ( length - 1 ) === 32 ) {
873+ length -- ;
874+ }
875+
876+ // No need to copy the whole string if there is no space at the end
877+ if ( length !== ctx . pathname . length ) {
878+ ctx . pathname = ctx . pathname . slice ( 0 , length ) ;
879+ }
880+ }
868881 }
869882 ctx . href = constructHref ( ctx ) ;
870883}
Original file line number Diff line number Diff line change 77 "skip" : " TODO: port from .window.js"
88 },
99 "historical.any.js" : {
10- "requires" : [" small-icu" ]
10+ "requires" : [" small-icu" ],
11+ "fail" : {
12+ "expected" : [
13+ " URL: no structured serialize/deserialize support" ,
14+ " URLSearchParams: no structured serialize/deserialize support"
15+ ]
16+ }
1117 },
1218 "urlencoded-parser.any.js" : {
1319 "requires" : [" small-icu" ]
Original file line number Diff line number Diff line change @@ -15,6 +15,6 @@ runner.setScriptModifier((obj) => {
1515} ) ;
1616runner . pretendGlobalThisAs ( 'Window' ) ;
1717runner . setInitScript ( `
18- globalThis.location = {};
18+ globalThis.location || = {};
1919` ) ;
2020runner . runJsTests ( ) ;
You can’t perform that action at this time.
0 commit comments