From d6efda034a36ffd9199451e948f063ccc8fdf09a Mon Sep 17 00:00:00 2001 From: Scott Gress Date: Thu, 4 Feb 2016 13:39:30 -0600 Subject: [PATCH] Specify explicit default value for `sails.config.cors.allRoutes` --- lib/hooks/cors/README.md | 1 + lib/hooks/cors/index.js | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/hooks/cors/README.md b/lib/hooks/cors/README.md index 640fa7ea5d..041f377062 100644 --- a/lib/hooks/cors/README.md +++ b/lib/hooks/cors/README.md @@ -41,6 +41,7 @@ This hook sets the following implicit default configuration on `sails.config`: | Property | Type | Default | |-----------------------------------------------|:-------------:|-----------------| | `sails.config.cors.origin` | ((string)) | `'*'` +| `sails.config.cors.allRoutes` | ((boolean)) | `false` | `sails.config.cors.credentials` | ((boolean)) | `true` | `sails.config.cors.methods` | ((string)) | `'GET, POST, PUT, DELETE, OPTIONS, HEAD'` | `sails.config.cors.headers` | ((string)) | `'content-type'` diff --git a/lib/hooks/cors/index.js b/lib/hooks/cors/index.js index dac814a557..391ee400c1 100644 --- a/lib/hooks/cors/index.js +++ b/lib/hooks/cors/index.js @@ -28,6 +28,7 @@ module.exports = function(sails) { defaults: { cors: { origin: '*', + allRoutes: false, credentials: true, methods: 'GET, POST, PUT, DELETE, OPTIONS, HEAD', headers: 'content-type',