From 787256b5c6f2791068138c81f79c7d8dc0cc33a0 Mon Sep 17 00:00:00 2001 From: Calum Muir Date: Mon, 22 Dec 2025 13:18:03 +0000 Subject: [PATCH] Handle contact route with trailing slash --- src/worker.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/worker.ts b/src/worker.ts index 661d8e3..2669e41 100644 --- a/src/worker.ts +++ b/src/worker.ts @@ -151,7 +151,10 @@ const handleContact = async (request: Request, env: Env) => { export default { async fetch(request: Request, env: Env): Promise { const url = new URL(request.url); - if (url.pathname === "/api/contact") { + if ( + url.pathname === "/api/contact" || + url.pathname === "/api/contact/" + ) { if (request.method !== "POST") { return jsonResponse( { ok: false, error: "Method not allowed." },