Skip to main content

CORS

Controls the Cross-Origin Resource Sharing (CORS).

Allows you to manage multiple origins and their headers.


add​


_cors.add(config: Values) : CORS​

Description​

Adds the settings for a new CORS definition.

Attributes​
NAMETYPEDESCRIPTION
configValuesThe new CORS configuration
Return​

( CORS )

Current CORS instance.


all​


_cors.all() : Values​

Description​

Gets all CORS settings.

Return​

( Values )

All CORS settings configured.


getAll​


_cors.getAll() : Values​

Description​

Gets all CORS settings.

Return​

( Values )

All CORS settings configured.


isOriginEnabled​


_cors.isOriginEnabled(origin: string) : boolean​

Description​

Checks if a origin has already been defined and is active.d.

Attributes​
NAMETYPEDESCRIPTION
originstringOrigin that comes in the HTTP header.
Return​

( boolean )

If the origin is enabled.


load​


_cors.load() : CORS​

Description​

Performs source verification and makes header definitions in the HTTP request response.

Return​

( CORS )

Current CORS instance.


removeOrigin​


_cors.removeOrigin(origin: string) : CORS​

Description​

Removes the origin in every configuration it exists.

Attributes​
NAMETYPEDESCRIPTION
originstringOrigin that comes in the HTTP header.
Return​

( CORS )

If the origin was successfully disabled.