Skip to content

Commit d0c8d99

Browse files
committed
fix(middleware): add Access-Control-Allow-Credentials header for CORS compliance
1 parent a56acd4 commit d0c8d99

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

backend/magic-service/app/Infrastructure/Util/Middleware/CorsMiddleware.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface
2121
$response = Context::get(ResponseInterface::class);
2222
$response = $response
2323
->withHeader('Access-Control-Allow-Origin', '*')
24+
->withHeader('Access-Control-Allow-Credentials', 'true')
2425
->withHeader('Access-Control-Allow-Headers', 'DNT,Keep-Alive,User-Agent,Cache-Control,Content-Type,Authorization,application-code,organization-code,x-forwarded-user,token,request-id,Language,api-key')
2526
->withHeader('Access-Control-Allow-Methods', '*')
2627
->withHeader('Request-Id', CoContext::getOrSetRequestId());

backend/super-magic/app/api/middleware/options_middleware.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ async def dispatch(self, request: Request, call_next):
3535
response.headers["Access-Control-Allow-Origin"] = "*"
3636
response.headers["Access-Control-Allow-Methods"] = "GET, POST, PUT, DELETE, OPTIONS, PATCH"
3737
response.headers["Access-Control-Allow-Headers"] = "*"
38+
response.headers["Access-Control-Allow-Credentials"] = "true"
3839
response.headers["Access-Control-Max-Age"] = "3600"
3940
return response
4041

0 commit comments

Comments
 (0)