File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,6 @@ module.exports = async function (fastify, opts) {
2626
2727 function reply ( request , reply ) {
2828 var dest = request . req . url . replace ( this . basePath , '' )
29- reply . from ( dest )
29+ reply . from ( dest || '/' )
3030 }
3131}
Original file line number Diff line number Diff line change @@ -68,6 +68,9 @@ async function run () {
6868 const resultRoot = await got ( `http://localhost:${ server . server . address ( ) . port } /my-prefix/` )
6969 t . equal ( resultRoot . body , 'this is root' )
7070
71+ const withoutSlash = await got ( `http://localhost:${ server . server . address ( ) . port } /my-prefix` )
72+ t . equal ( withoutSlash . body , 'this is root' )
73+
7174 const resultA = await got ( `http://localhost:${ server . server . address ( ) . port } /my-prefix/a` )
7275 t . equal ( resultA . body , 'this is a' )
7376 } )
You can’t perform that action at this time.
0 commit comments