Skip to content
This repository was archived by the owner on Jun 23, 2026. It is now read-only.

Commit f277f3b

Browse files
committed
Don't erroneously remove slashes from URLs before KV lookup
1 parent 4f5455e commit f277f3b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

short-urls/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ interface Env {
2020

2121
const worker = {
2222
async fetch(request: Request, env: Env, ctx: ExecutionContext): Promise<Response> {
23-
let path = new URL(request.url).pathname.slice(1).replace(/\//, "");
23+
let path = new URL(request.url).pathname.slice(1).replace(/\/$/, "");
2424

2525
if (!path) {
2626
request.tracer.log("No path, forwarding to host.");

0 commit comments

Comments
 (0)