File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -223,7 +223,10 @@ class Mount {
223223
224224 // get a path from a url
225225 getPath ( u ) {
226- return path . join ( this . path , u )
226+ // trailing slash removal to fix Node.js v23 bug
227+ // https://github.com/nodejs/node/pull/55527
228+ // can be removed when this is resolved and released
229+ return path . join ( this . path , u . replace ( / \/ + $ / , '' ) )
227230 }
228231
229232 // get a url from a path
Original file line number Diff line number Diff line change @@ -97,6 +97,14 @@ test('multiball!', (t) => {
9797 }
9898} )
9999
100+ test ( 'trailing slash' , ( t ) => {
101+ req ( '/test/test/fixtures/' , ( er , res , body ) => {
102+ t . equal ( res . statusCode , 200 )
103+ t . ok ( / < h t m l > .* I n d e x o f \/ t e s t \/ f i x t u r e s < [ \s \S ] + i n d e x \. h t m l [ \s \S ] + s p a c e i n f i l e n a m e \. t x t [ \s \S ] + < \/ h t m l > / . test ( body . toString ( ) ) )
104+ t . end ( )
105+ } )
106+ } )
107+
100108test ( 'space in filename' , ( t ) => {
101109 req ( '/test/test/fixtures/space in filename.txt' , ( er , res , body ) => {
102110 t . equal ( res . statusCode , 200 )
You can’t perform that action at this time.
0 commit comments