Skip to content

Commit

Permalink
modify CORS
Browse files Browse the repository at this point in the history
add CORS for all requests as listener
  • Loading branch information
labudzinski committed Jun 12, 2024
1 parent 6add7a0 commit 1eaa0c8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/EventListener/CorsListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function onKernelResponse(ResponseEvent $event): void
return;
}
$crossOriginHeaders = [
'Allow' => 'GET, OPTIONS',
'Access-Control-Max-Age' => 600,
'Access-Control-Allow-Origin' => '*',
'Access-Control-Allow-Credentials' => 'true',
'Access-Control-Allow-Methods' => implode(',', [
Expand All @@ -64,7 +64,9 @@ public function onKernelResponse(ResponseEvent $event): void
'X-Requested-With',
'If-Modified-Since',
'Cache-Control',
'Content-Type'
'Content-Type',
'Access-Control-Request-Method',
'Access-Control-Request-Headers'
]),
];
$request = $event->getRequest();
Expand Down

0 comments on commit 1eaa0c8

Please sign in to comment.