Skip to content

Commit

Permalink
Add basepath when redirecting from a trailling slash (#8966)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbudz authored Nov 10, 2016
1 parent 60e62c7 commit 6236843
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 @@ -103,10 +103,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 6236843

Please sign in to comment.