PHP Class Nord\Lumen\Cors\CorsService

Inheritance: implements Nord\Lumen\Cors\Contracts\CorsService
Afficher le fichier Open project: nordsoftware/lumen-cors Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( array $config = [] ) CorsService constructor.
handlePreflightRequest ( Request $request )
handleRequest ( Request $request, Response $response )
isCorsRequest ( Request $request )
isPreflightRequest ( Request $request )

Méthodes protégées

Méthode Description
configure ( array $config ) Configures the service.
createErrorResponse ( string $content = '', integer $status = 400 ) : Illuminate\Http\Response Creates an error response.
createHeaderNotAllowedResponse ( Request $request )
createMethodNotAllowedResponse ( Request $request )
createOriginNotAllowedResponse ( Request $request )
createPreflightResponse ( Request $request ) : Response Creates a preflight response.
createResponse ( Request $request, Response $response ) : Response
isAllHeadersAllowed ( ) : boolean
isAllMethodsAllowed ( ) : boolean
isAllOriginsAllowed ( ) : boolean
isHeaderAllowed ( string $header ) : boolean Returns whether or not the header is allowed.
isMethodAllowed ( string $method ) : boolean Returns whether or not the method is allowed.
isOriginAllowed ( string $origin ) : boolean Returns whether or not the origin is allowed.
setAllowCredentials ( boolean $allowCredentials )
setAllowHeaders ( array $allowHeaders )
setAllowMethods ( array $allowMethods )
setAllowOrigins ( array $allowOrigins )
setExposeHeaders ( array $exposeHeaders )
setHeaderNotAllowed ( Callable $headerNotAllowed )
setMaxAge ( integer $maxAge )
setMethodNotAllowed ( Callable $methodNotAllowed )
setOriginNotAllowed ( Callable $originNotAllowed )
validatePreflightRequest ( Request $request )
validateRequest ( Request $request )

Method Details

__construct() public méthode

CorsService constructor.
public __construct ( array $config = [] )
$config array

configure() protected méthode

Configures the service.
protected configure ( array $config )
$config array

createErrorResponse() protected méthode

Creates an error response.
protected createErrorResponse ( string $content = '', integer $status = 400 ) : Illuminate\Http\Response
$content string
$status integer
Résultat Illuminate\Http\Response

createHeaderNotAllowedResponse() protected méthode

protected createHeaderNotAllowedResponse ( Request $request )
$request Symfony\Component\HttpFoundation\Request

createMethodNotAllowedResponse() protected méthode

protected createMethodNotAllowedResponse ( Request $request )
$request Symfony\Component\HttpFoundation\Request

createOriginNotAllowedResponse() protected méthode

protected createOriginNotAllowedResponse ( Request $request )
$request Symfony\Component\HttpFoundation\Request

createPreflightResponse() protected méthode

Creates a preflight response.
protected createPreflightResponse ( Request $request ) : Response
$request Symfony\Component\HttpFoundation\Request
Résultat Symfony\Component\HttpFoundation\Response

createResponse() protected méthode

protected createResponse ( Request $request, Response $response ) : Response
$request Symfony\Component\HttpFoundation\Request
$response Symfony\Component\HttpFoundation\Response
Résultat Symfony\Component\HttpFoundation\Response

handlePreflightRequest() public méthode

public handlePreflightRequest ( Request $request )
$request Symfony\Component\HttpFoundation\Request

handleRequest() public méthode

public handleRequest ( Request $request, Response $response )
$request Symfony\Component\HttpFoundation\Request
$response Symfony\Component\HttpFoundation\Response

isAllHeadersAllowed() protected méthode

protected isAllHeadersAllowed ( ) : boolean
Résultat boolean

isAllMethodsAllowed() protected méthode

protected isAllMethodsAllowed ( ) : boolean
Résultat boolean

isAllOriginsAllowed() protected méthode

protected isAllOriginsAllowed ( ) : boolean
Résultat boolean

isCorsRequest() public méthode

public isCorsRequest ( Request $request )
$request Symfony\Component\HttpFoundation\Request

isHeaderAllowed() protected méthode

Returns whether or not the header is allowed.
protected isHeaderAllowed ( string $header ) : boolean
$header string
Résultat boolean

isMethodAllowed() protected méthode

Returns whether or not the method is allowed.
protected isMethodAllowed ( string $method ) : boolean
$method string
Résultat boolean

isOriginAllowed() protected méthode

Returns whether or not the origin is allowed.
protected isOriginAllowed ( string $origin ) : boolean
$origin string
Résultat boolean

isPreflightRequest() public méthode

public isPreflightRequest ( Request $request )
$request Symfony\Component\HttpFoundation\Request

setAllowCredentials() protected méthode

protected setAllowCredentials ( boolean $allowCredentials )
$allowCredentials boolean

setAllowHeaders() protected méthode

protected setAllowHeaders ( array $allowHeaders )
$allowHeaders array

setAllowMethods() protected méthode

protected setAllowMethods ( array $allowMethods )
$allowMethods array

setAllowOrigins() protected méthode

protected setAllowOrigins ( array $allowOrigins )
$allowOrigins array

setExposeHeaders() protected méthode

protected setExposeHeaders ( array $exposeHeaders )
$exposeHeaders array

setHeaderNotAllowed() protected méthode

protected setHeaderNotAllowed ( Callable $headerNotAllowed )
$headerNotAllowed Callable

setMaxAge() protected méthode

protected setMaxAge ( integer $maxAge )
$maxAge integer

setMethodNotAllowed() protected méthode

protected setMethodNotAllowed ( Callable $methodNotAllowed )
$methodNotAllowed Callable

setOriginNotAllowed() protected méthode

protected setOriginNotAllowed ( Callable $originNotAllowed )
$originNotAllowed Callable

validatePreflightRequest() protected méthode

protected validatePreflightRequest ( Request $request )
$request Symfony\Component\HttpFoundation\Request

validateRequest() protected méthode

protected validateRequest ( Request $request )
$request Symfony\Component\HttpFoundation\Request