abstract class AccessControlAllowOrigin implements MiddlewareInterface

Access control allow origin middleware.

Properties

protected bool $allowAll Allow all domains?
protected array $allowedDomains Allowed domains.

Methods

string|null
getOrigin(Request $request)

Returns the request origin.

bool
isDomainAllowed(string $domain)

Returns TRUE if the domain is allowed and FALSE if not.

execute(Request $request, Response $response, Closure $next)

Executes the middleware.

Details

at line 41
protected string|null getOrigin(Request $request)

Returns the request origin.

Parameters

Request $request Request instance

Return Value

string|null

at line 52
protected bool isDomainAllowed(string $domain)

Returns TRUE if the domain is allowed and FALSE if not.

Parameters

string $domain Domain

Return Value

bool

at line 60
Response execute(Request $request, Response $response, Closure $next)

Executes the middleware.

Parameters

Request $request Request
Response $response Response
Closure $next Next layer

Return Value

Response