public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
{
$response = $handler->handle($request);
return $response
->withHeader(Header::ALLOW, '*')
->withHeader(Header::VARY, 'Origin')
->withHeader(Header::ACCESS_CONTROL_ALLOW_ORIGIN, '*')
->withHeader(Header::ACCESS_CONTROL_ALLOW_METHODS, 'GET,OPTIONS,HEAD,POST,PUT,PATCH,DELETE')
->withHeader(Header::ACCESS_CONTROL_ALLOW_HEADERS, '*')
->withHeader(Header::ACCESS_CONTROL_EXPOSE_HEADERS, '*')
->withHeader(Header::ACCESS_CONTROL_ALLOW_CREDENTIALS, 'true')
->withHeader(Header::ACCESS_CONTROL_MAX_AGE, '86400');
}
User Contributed Notes
Leave a comment
Join the conversation to share a note.