diff --git a/src/middleware/cors/index.test.ts b/src/middleware/cors/index.test.ts index 5672be50e..7060ca49e 100644 --- a/src/middleware/cors/index.test.ts +++ b/src/middleware/cors/index.test.ts @@ -81,6 +81,7 @@ describe('CORS by Middleware', () => { const res = await app.request(req) expect(res.status).toBe(204) + expect(res.statusText).toBe('No Content') expect(res.headers.get('Access-Control-Allow-Methods')?.split(',')[0]).toBe('GET') expect(res.headers.get('Access-Control-Allow-Headers')?.split(',')).toEqual([ 'X-PINGOTHER', diff --git a/src/middleware/cors/index.ts b/src/middleware/cors/index.ts index f6c848db6..94d587f85 100644 --- a/src/middleware/cors/index.ts +++ b/src/middleware/cors/index.ts @@ -137,7 +137,7 @@ export const cors = (options?: CORSOptions): MiddlewareHandler => { return new Response(null, { headers: c.res.headers, status: 204, - statusText: c.res.statusText, + statusText: 'No Content', }) } await next()