fix: typings fix for Response.redirect call (#81)
Co-authored-by: Boaz Blake <BBlake@goempyrean.com>
This commit is contained in:
@@ -148,7 +148,7 @@ export class ServerContext {
|
|||||||
const url = new URL(req.url);
|
const url = new URL(req.url);
|
||||||
if (url.pathname.length > 1 && url.pathname.endsWith("/")) {
|
if (url.pathname.length > 1 && url.pathname.endsWith("/")) {
|
||||||
url.pathname = url.pathname.slice(0, -1);
|
url.pathname = url.pathname.slice(0, -1);
|
||||||
return Response.redirect(url, 307);
|
return Response.redirect(url.href, 307);
|
||||||
}
|
}
|
||||||
const handle = () => Promise.resolve(inner(req));
|
const handle = () => Promise.resolve(inner(req));
|
||||||
return middleware.handler(req, handle);
|
return middleware.handler(req, handle);
|
||||||
|
|||||||
Reference in New Issue
Block a user