bugfixes/cors-problem #7
@@ -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);
|
||||
|
TorstenHettstedt marked this conversation as resolved
|
||||
|
||||
// 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;
|
||||
|
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