From af099240b6f0b8079a38e1f0749932a7fc833bfb Mon Sep 17 00:00:00 2001 From: gentlementlegen Date: Fri, 4 Oct 2024 16:32:15 +0900 Subject: [PATCH] chore: changed manifest endpoint --- src/worker.ts | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/worker.ts b/src/worker.ts index 2134d3d..f90eea2 100644 --- a/src/worker.ts +++ b/src/worker.ts @@ -7,16 +7,10 @@ export default { async fetch(request: Request, env: Env): Promise { try { const url = new URL(request.url); - if (url.pathname === "/manifest") { - if (request.method === "GET") { - return new Response(JSON.stringify(manifest), { - headers: { "content-type": "application/json" }, - }); - } else if (request.method === "POST") { - const webhookPayload = await request.json(); - validateAndDecodeSchemas(env, webhookPayload.settings); - return new Response(JSON.stringify({ message: "Schema is valid" }), { status: 200, headers: { "content-type": "application/json" } }); - } + if (url.pathname === "/manifest.json" && request.method === "GET") { + return new Response(JSON.stringify(manifest), { + headers: { "content-type": "application/json" }, + }); } if (request.method !== "POST") { return new Response(JSON.stringify({ error: `Only POST requests are supported.` }), {