From d780fa5055dc421c9897c420687f1c934bc2102a Mon Sep 17 00:00:00 2001 From: dangered wolf Date: Tue, 23 Apr 2024 06:48:02 -0400 Subject: [PATCH] fix: OPTIONS should not attempt to return a body --- src/caches.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/caches.ts b/src/caches.ts index 5d3b9a4..a9c1229 100644 --- a/src/caches.ts +++ b/src/caches.ts @@ -91,8 +91,7 @@ export const cacheMiddleware = (): MiddlewareHandler => async (c, next) => { case 'OPTIONS': c.header('allow', Constants.RESPONSE_HEADERS.allow); c.status(204); - if (returnAsJson) return c.json(''); - return c.html(''); + return; default: c.status(405); if (returnAsJson) return c.json('');