Merge pull request #591 from thgh/redirect-basepath

Fix redirect with basepath
This commit is contained in:
Rich Harris
2019-04-29 11:43:51 -04:00
committed by GitHub
5 changed files with 54 additions and 3 deletions

View File

@@ -177,7 +177,7 @@ export function get_page_handler(
try {
if (redirect) {
const location = URL.resolve(req.baseUrl || '/', redirect.location);
const location = URL.resolve((req.baseUrl || '') + '/', redirect.location);
res.statusCode = redirect.statusCode;
res.setHeader('Location', location);