Documentation

Cors
in package
implements MiddlewareInterface

Adds cross-origin resource sharing headers as configured server-wide.

Tags
since
18.0.41

Interfaces, Classes and Traits

MiddlewareInterface

Table of Contents

CORS_CREDENTIALS_HEADER  = 'Access-Control-Allow-Credentials'
CORS_EXPOSE_HEADER  = 'Access-Control-Expose-Headers'
CORS_HEADERS_HEADER  = 'Access-Control-Allow-Headers'
CORS_METHODS_HEADER  = 'Access-Control-Allow-Methods'
CORS_ORIGIN_HEADER  = 'Access-Control-Allow-Origin'
REQUEST_ORIGIN_HEADER  = 'Origin'
__construct()  : mixed
process()  : ResponseInterface

Constants

CORS_CREDENTIALS_HEADER

private mixed CORS_CREDENTIALS_HEADER = 'Access-Control-Allow-Credentials'

CORS_EXPOSE_HEADER

private mixed CORS_EXPOSE_HEADER = 'Access-Control-Expose-Headers'

CORS_HEADERS_HEADER

private mixed CORS_HEADERS_HEADER = 'Access-Control-Allow-Headers'

CORS_METHODS_HEADER

private mixed CORS_METHODS_HEADER = 'Access-Control-Allow-Methods'

CORS_ORIGIN_HEADER

private mixed CORS_ORIGIN_HEADER = 'Access-Control-Allow-Origin'

REQUEST_ORIGIN_HEADER

private mixed REQUEST_ORIGIN_HEADER = 'Origin'

Methods

__construct()

public __construct(ResponseFactoryInterface $factory[, array<string|int, mixed> $options = [] ]) : mixed
Parameters
$factory : ResponseFactoryInterface
$options : array<string|int, mixed> = []
Return values
mixed

process()

public process(ServerRequestInterface $request, RequestHandlerInterface $handler) : ResponseInterface
Parameters
$request : ServerRequestInterface
$handler : RequestHandlerInterface
Return values
ResponseInterface

Search results