mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
Add basepath when redirecting from a trailling slash (#9033)
Backports PR #8966
**Commit 1:**
Add basepath when redirecting from a trailling slash
* Original sha: 442bcb9044
* Authored by Jonathan Budzenski <jon@jbudz.me> on 2016-11-04T13:33:24Z
This commit is contained in:
parent
4a76abcca7
commit
321e7e53f2
1 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue