CorsMiddleware
final class CorsMiddleware implements MiddlewareInterface (View source)
Applies the resolved CORS policy and terminates valid preflight requests.
Methods
__construct(CorsConfig $config, ResponseFactoryInterface $responseFactory)
Connects the immutable CORS policy with blank-response creation.
process(ServerRequestInterface $request, RequestHandlerInterface $handler)
Delegates ordinary requests and adds CORS headers only for configured allowed origins.
ResponseInterface
Details
__construct
__construct(CorsConfig $config, ResponseFactoryInterface $responseFactory)
Connects the immutable CORS policy with blank-response creation.
process
ResponseInterface
process(ServerRequestInterface $request, RequestHandlerInterface $handler)
Delegates ordinary requests and adds CORS headers only for configured allowed origins.