From 57a26ef6cdfc3face6dba29f32230328e2e3a83d Mon Sep 17 00:00:00 2001 From: Tobias Schneider Date: Thu, 4 Nov 2021 00:07:13 +0100 Subject: [PATCH] Fix cors config --- index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/index.js b/index.js index 849bdf1..3c10453 100644 --- a/index.js +++ b/index.js @@ -230,11 +230,11 @@ class Router { cors(config) { config = config || {} this.corsConfig = { - allowOrigin: '*', - allowMethods: '*', - allowHeaders: '*', - maxAge: 86400, - optionsSuccessStatus: 204 + allowOrigin: config.allowOrigin || '*', + allowMethods: config.allowMethods || '*', + allowHeaders: config.allowHeaders || '*, Authorization', + maxAge: config.maxAge || 86400, + optionsSuccessStatus: config.optionsSuccessStatus || 204 } return this }