bugfixes/cors-problem #7
@@ -35,12 +35,12 @@ class OriginAccessControlHandler implements MiddlewareInterface
|
|||||||
$requestHeaders = $request->getHeaderLine('Access-Control-Request-Headers');
|
$requestHeaders = $request->getHeaderLine('Access-Control-Request-Headers');
|
||||||
|
|
||||||
if ($this->testRoute($request)) {
|
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-Origin', $this->buildOrigin($request));
|
||||||
$response = $response->withHeader('Access-Control-Allow-Methods', implode(',', $methods));
|
$response = $response->withHeader('Access-Control-Allow-Methods', implode(',', $methods));
|
||||||
$response = $response->withHeader('Access-Control-Allow-Headers', $requestHeaders);
|
$response = $response->withHeader('Access-Control-Allow-Headers', $requestHeaders);
|
||||||
|
TorstenHettstedt marked this conversation as resolved
|
|||||||
|
$response = $response->withHeader('Access-Control-Max-Age', (string)$accessControlMaxAge);
|
||||||
// Optional: Allow Ajax CORS requests with Authorization header
|
|
||||||
$response = $response->withHeader('Access-Control-Allow-Credentials', 'true');
|
|
||||||
}
|
}
|
||||||
return $response;
|
return $response;
|
||||||
|
TorstenHettstedt marked this conversation as resolved
TorstenHettstedt
commented
Braucht es das wirklich? Braucht es das wirklich?
|
|||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user
Da fehlt noch was:
Access-Control-Max-Age: 86400