Skip to content

Commit

Permalink
add CORS origin from request
Browse files Browse the repository at this point in the history
  • Loading branch information
labudzinski committed Jun 11, 2024
1 parent 6ee2c8e commit a8dc881
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Controller/DownloadController.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,9 @@ public function download(): Response
'Content-Type'
]),
];
if($this->request->headers->has('Origin')) {
$crossOriginHeaders['Access-Control-Allow-Origin'] = $this->request->headers->get('Origin');
}

// Send empty response for OPTIONS requests
if ($this->request->isMethod('OPTIONS')) {
Expand Down

0 comments on commit a8dc881

Please sign in to comment.