mirror of
https://github.com/shlinkio/shlink.git
synced 2026-02-28 04:03:12 +08:00
Allow credentials to be enabled in CORS
This commit is contained in:
@@ -44,6 +44,10 @@ readonly class CrossDomainMiddleware implements MiddlewareInterface, RequestMeth
|
||||
'Access-Control-Max-Age' => $this->options->maxAge,
|
||||
];
|
||||
|
||||
if ($this->options->allowCredentials) {
|
||||
$corsHeaders['Access-Control-Allow-Credentials'] = 'true';
|
||||
}
|
||||
|
||||
// Options requests should always be empty and have a 204 status code
|
||||
return EmptyResponse::withHeaders([...$response->getHeaders(), ...$corsHeaders]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user