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 }