Alle notwendigen Header werden mitgeliefert.
This commit is contained in:
@@ -35,12 +35,12 @@ class OriginAccessControlHandler implements MiddlewareInterface
|
||||
$requestHeaders = $request->getHeaderLine('Access-Control-Request-Headers');
|
||||
|
||||
if ($this->testRoute($request)) {
|
||||
// Stunden Minuten Sekunden
|
||||
$accessControlMaxAge = 24 * 60 * 60;
|
||||
$response = $response->withHeader('Access-Control-Allow-Origin', $this->buildOrigin($request));
|
||||
$response = $response->withHeader('Access-Control-Allow-Methods', implode(',', $methods));
|
||||
$response = $response->withHeader('Access-Control-Allow-Headers', $requestHeaders);
|
||||
|
||||
// Optional: Allow Ajax CORS requests with Authorization header
|
||||
$response = $response->withHeader('Access-Control-Allow-Credentials', 'true');
|
||||
$response = $response->withHeader('Access-Control-Max-Age', (string)$accessControlMaxAge);
|
||||
}
|
||||
return $response;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user