From 4b239a4ebb7345e19b35ed34ef185a9fb6bd0b8a Mon Sep 17 00:00:00 2001 From: deepshekhardas Date: Mon, 25 May 2026 17:17:55 +0530 Subject: [PATCH] fix(graphql): add missing CORS headers to successful responses The CORS init hook was registered with groups(['api', 'web']) but GraphQL routes use groups(['graphql']), so the hook never fired for GraphQL requests. Responses via GET /v1/graphql and POST /v1/graphql were missing Access-Control-Allow-Origin and other CORS headers, breaking cross-origin browser usage. Add 'graphql' to the CORS init hook groups so CORS headers are set on all successful GraphQL responses. --- app/controllers/general.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/general.php b/app/controllers/general.php index 219c14774f..49a74ad470 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -982,7 +982,7 @@ Http::init() * @see https://www.owasp.org/index.php/List_of_useful_HTTP_headers */ Http::init() - ->groups(['api', 'web']) + ->groups(['api', 'web', 'graphql']) ->inject('request') ->inject('response') ->inject('cors')