From caa4ee39d14a3a0829521b8113e20fd1725557e8 Mon Sep 17 00:00:00 2001 From: gentlementlegen Date: Fri, 4 Oct 2024 17:03:29 +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 33370a1..72b9a61 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.` }), {