Download the PHP package papimod/cors without Composer
On this page you can find all versions of the php package papimod/cors. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package cors
CORS Papi Module
Description
Help setting up cross-origin resource sharing in your papi.
This module is based on the official tutorial.
Prerequisites Modules
Configuration
CORS_ORIGIN (.ENV)
| Required | No |
| Type | string |
| Description | Set Access-Control-Allow-Origin |
| Default | * |
CORS_METHODS (.ENV)
| Required | No |
| Type | string |
| Description | Set Access-Control-Allow-Methods |
| Default | GET, POST, PUT, PATCH, DELETE, OPTIONS |
CORS_MAX_AGE (.ENV)
| Required | No |
| Type | string |
| Description | Set Access-Control-Max-Age |
| Default | 3600 |
CORS_HEADERS (.ENV)
| Required | No |
| Type | string |
| Description | Set Access-Control-Allow-Headers |
| Default | * |
CORS_EXPOSE_HEADERS (.ENV)
| Required | No |
| Type | string |
| Description | Set Access-Control-Expose-Headers |
| Default | * |
Usage
You can add the following options to your .env file:
Import the module when creating your application:
MDN Recommendations
-
The server must not specify the
*wildcard for theAccess-Control-Allow-Originresponse-header value, but must instead specify an explicit origin; for example:Access-Control-Allow-Origin: https://example.com -
The server must not specify the
*wildcard for theAccess-Control-Allow-Headersresponse-header value, but must instead specify an explicit list of header names; for example,Access-Control-Allow-Headers: X-PINGOTHER, Content-Type -
The server must not specify the
*wildcard for theAccess-Control-Allow-Methodsresponse-header value, but must instead specify an explicit list of method names; for example,Access-Control-Allow-Methods: POST, GET - The server must not specify the
*wildcard for theAccess-Control-Expose-Headersresponse-header value, but must instead specify an explicit list of header names; for example,Access-Control-Expose-Headers: Content-Encoding, Kuma-Revision
All versions of cors with dependencies
papi/papi Version ^2.1.1
papimod/dotenv Version ^2.1.0
papimod/http-error Version ^2.1.0