Skip to content

Commit

Permalink
Add basepath when redirecting from a trailling slash
Browse files Browse the repository at this point in the history
  • Loading branch information
jbudz committed Nov 4, 2016
1 parent b2e3e5e commit 442bcb9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/server/http/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@ module.exports = async function (kbnServer, server, config) {
if (path === '/' || path.charAt(path.length - 1) !== '/') {
return reply(Boom.notFound());
}

const pathPrefix = config.get('server.basePath') ? `${config.get('server.basePath')}/` : '';
return reply.redirect(format({
search: req.url.search,
pathname: path.slice(0, -1),
pathname: pathPrefix + path.slice(0, -1),
}))
.permanent(true);
}
Expand Down

0 comments on commit 442bcb9

Please sign in to comment.