cors

Add CORS headers to your app in one module

This module detects CORS requests, validates them against the configured origins, and handles preflight requests.

The following is the default configuration.

settings = {
    allowOrigins = "*",
    allowMethods = [ "DELETE", "GET", "PATCH", "POST", "PUT", "OPTIONS" ],
    allowHeaders = [ "Content-Type", "X-Auth-Token", "Origin", "Authorization" ],
    maxAge = 60 * 60 * 24, // 1 day
    allowCredentials = true,
    eventPattern = [ "^Main\.ajax$", "api" ]
};

31 Jan 2018 — 23:23: 01 UTC

chore

  • build: trigger minor release (ef05a5c)

31 Jan 2018 — 23:11: 40 UTC

feat

  • events: Add eventPattern to settings (#2) (b7544a9)

27 Jan 2018 — 06:09: 38 UTC

chore

  • build: Remove unnecessary package scripts (88f7e90)
  • build: Fix ACF builds (dc433de)
  • build: Add Travis CI and Semantic Release (d084e2f)

feat

  • cors: Add isAllowed check and response (36d605e)
  • cors: Send a generic preflight back if none defined (352e20d)

other

Here are all the versions for this package. Please note that you can leverage CommandBox package versioning to install any package you like. Please refer to our managing package version guide for more information.

Version Created Last Update Published By Stable Download
1.4.1 Jan 31 2018 05:23 PM Jan 31 2018 05:23 PM Eric Peterson (elpete)
1.4.0 Jan 31 2018 05:11 PM Jan 31 2018 05:11 PM Eric Peterson (elpete)
1.3.0 Jan 27 2018 12:09 AM Jan 27 2018 12:09 AM Eric Peterson (elpete)
1.2.0 Jan 27 2018 12:00 AM Jan 27 2018 12:00 AM Eric Peterson (elpete)
1.1.0 Jan 25 2018 04:50 PM Jan 25 2018 04:50 PM Eric Peterson (elpete)
1.0.0 Feb 24 2017 10:35 AM Feb 24 2017 10:35 AM Eric Peterson (elpete)

 

No collaborators yet.
     
  • Feb 24 2017 10:35 AM
  • Jan 31 2018 05:23 PM
  • 985
  • 0
  • 1883