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 @@ -872,6 +872,19 @@ function update(url, params) {
872872 ctx . search = '?' + serializedParams ;
873873 } else {
874874 ctx . search = '' ;
875+
876+ // Potentially strip trailing spaces from an opaque path
877+ if ( ctx . hasOpaquePath && ctx . hash . length === 0 ) {
878+ let length = ctx . pathname . length ;
879+ while ( length > 0 && ctx . pathname . charCodeAt ( length - 1 ) === 32 ) {
880+ length -- ;
881+ }
882+
883+ // No need to copy the whole string if there is no space at the end
884+ if ( length !== ctx . pathname . length ) {
885+ ctx . pathname = ctx . pathname . slice ( 0 , length ) ;
886+ }
887+ }
875888 }
876889 ctx . href = constructHref ( ctx ) ;
877890}
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