FORGEBOX Enterprise 🚀 - Take your ColdFusion (CFML) Development to Modern Times! Learn More...

cors

v2.2.0 Public

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 = {
    autoRegisterInterceptor = true,

    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" ]
};

autoRegisterInterceptor

If you need more control over the order of your interceptors you can disable the automatic loading of the CORS interceptor. If you do this you will need to register it yourself (most likely in config/ColdBox.cfc) as cors.interceptors.CORS.

v2.2.0

10 Sep 2019 — 21:52: 09 UTC

feat

  • ModuleConfig: Add flag to prevent automatic loading (240e306)

fix

  • build: Use OpenJDK instead of Oracle (b0cc52b)

v2.1.0

09 Aug 2019 — 21:57: 25 UTC

chore

feat

  • cors: Dynamically determine allowed headers (25a98ba)
  • cors: Dynamically determine allowed methods (1e33450)
  • cors: Dynamically determine allowed origins (97cae05)

v2.0.3

16 Jul 2019 — 21:38: 52 UTC

other

  • *: chore: Add debug logging for future debugging (73c0190)

v2.0.2

15 Jul 2019 — 16:35: 09 UTC

other

  • *: chore: remove Node dependencies (429e68c)
  • *: fix: Move postProcess to preEvent to fit within caching lifecycle (d2184f0)
  • *: fix: Remove duplicate code (091140e)

v2.0.1

11 Jul 2019 — 22:08: 54 UTC

fix

  • Caching: Fix for event caching when expiring (a06dbfa)

v2.0.0

10 Jul 2019 — 19:41: 08 UTC

BREAKING

  • CORS: Ignore cached events for CORS (9d6fd4c)

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 Actions
Current
2.2.0 Sep 10 2019 04:52 PM Sep 10 2019 04:52 PM
Version History
2.1.0 Aug 09 2019 04:57 PM Aug 09 2019 04:57 PM
2.0.3 Jul 16 2019 04:38 PM Jul 16 2019 04:38 PM
2.0.2 Jul 15 2019 11:35 AM Jul 15 2019 11:35 AM
2.0.1 Jul 11 2019 05:08 PM Jul 11 2019 05:08 PM
2.0.0 Jul 10 2019 02:41 PM Jul 10 2019 02:41 PM
1.4.1 Jan 31 2018 05:23 PM Jan 31 2018 05:23 PM
1.4.0 Jan 31 2018 05:11 PM Jan 31 2018 05:11 PM
1.3.0 Jan 27 2018 12:09 AM Jan 27 2018 12:09 AM
1.2.0 Jan 27 2018 12:00 AM Jan 27 2018 12:00 AM
1.1.0 Jan 25 2018 04:50 PM Jan 25 2018 04:50 PM
1.0.0 Feb 24 2017 10:35 AM Feb 24 2017 10:35 AM

 

No collaborators yet.
     
  • Feb 24 2017 10:35 AM
  • Sep 10 2019 04:52 PM
  • 1288
  • 0
  • 2871