diff --git a/handshake-api/index.js b/handshake-api/index.js index f92ccf05..896514fb 100644 --- a/handshake-api/index.js +++ b/handshake-api/index.js @@ -69,6 +69,9 @@ server.use( proxy("nginx", { // eslint-disable-next-line no-unused-vars userResHeaderDecorator(headers, userReq, userRes, proxyReq, proxyRes) { + if (!userReq.path.endsWith("/")) { + userRes.redirect(307, `${userReq.path}/`); + } if (headers.location && headers.location.match(startsWithSkylinkRegExp)) { headers.location = headers.location.replace(startsWithSkylinkRegExp, `/hns/${userReq.params.name}`); }