OptionsMiddleware
final class OptionsMiddleware implements MiddlewareInterface (View source)
Supplies automatic OPTIONS responses when no explicit OPTIONS route owns a path.
Methods
__construct(Router $router, ResponseFactoryInterface $responseFactory)
Initializes automatic OPTIONS handling against the shared route collection.
process(ServerRequestInterface $request, RequestHandlerInterface $handler)
Delegates non-OPTIONS and explicit routes, otherwise returns the allowed methods.
ResponseInterface
Details
__construct
__construct(Router $router, ResponseFactoryInterface $responseFactory)
Initializes automatic OPTIONS handling against the shared route collection.
process
ResponseInterface
process(ServerRequestInterface $request, RequestHandlerInterface $handler)
Delegates non-OPTIONS and explicit routes, otherwise returns the allowed methods.