From b4d515a9c74d4999e7c56b1ca915fb1b96c96b86 Mon Sep 17 00:00:00 2001 From: multipleof4 Date: Sat, 14 Feb 2026 11:55:28 -0800 Subject: [PATCH] Feat: Serve limit.webp meme on rate limit instead of JSON --- functions/[[path]].js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/functions/[[path]].js b/functions/[[path]].js index 94dbf61..ad44441 100644 --- a/functions/[[path]].js +++ b/functions/[[path]].js @@ -4,7 +4,7 @@ export async function onRequest(context) { const path = params.path?.join("/") || ""; // Serve static assets for root or standard files - if (!path || path === "index.html" || path === "favicon.ico" || path === "robots.txt") { + if (!path || path === "index.html" || path === "favicon.ico" || path === "robots.txt" || path === "limit.webp") { return env.ASSETS.fetch(request); } @@ -51,9 +51,9 @@ export async function onRequest(context) { tags: "warning,no_entry", priority: 2 })); - return jsonResponse(429, { - error: "Daily search limit reached (25/day). Cached images remain available.", - }); + // Serve the limit meme image instead of JSON + const limitReq = new Request(new URL("/limit.webp", url.origin)); + return env.ASSETS.fetch(limitReq); } // Notify of a new search (Cache Miss)