Skip to content

Commit c947d99

Browse files
committed
fix: // in path?
1 parent 7425957 commit c947d99

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/functions/redirect.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export async function redirect(
2121
let headers = { Location: DEFAULT_TARGET };
2222

2323
const restOfPath = request.params?.restOfPath;
24-
const urlPath = restOfPath ? `/${restOfPath}` : "/";
24+
const urlPath = restOfPath ? `/${restOfPath.replace(/^\/+/, "")}` : "/";
2525
const acceptHeader = request.headers.get("Accept") ?? "*/*";
2626
const acceptMediaTypes = mediaTypes(acceptHeader);
2727

0 commit comments

Comments
 (0)