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) {
26
26
27
27
function reply ( request , reply ) {
28
28
var dest = request . req . url . replace ( this . basePath , '' )
29
- reply . from ( dest )
29
+ reply . from ( dest || '/' )
30
30
}
31
31
}
Original file line number Diff line number Diff line change @@ -68,6 +68,9 @@ async function run () {
68
68
const resultRoot = await got ( `http://localhost:${ server . server . address ( ) . port } /my-prefix/` )
69
69
t . equal ( resultRoot . body , 'this is root' )
70
70
71
+ const withoutSlash = await got ( `http://localhost:${ server . server . address ( ) . port } /my-prefix` )
72
+ t . equal ( withoutSlash . body , 'this is root' )
73
+
71
74
const resultA = await got ( `http://localhost:${ server . server . address ( ) . port } /my-prefix/a` )
72
75
t . equal ( resultA . body , 'this is a' )
73
76
} )
You can’t perform that action at this time.
0 commit comments