Fix cors config
This commit is contained in:
10
index.js
10
index.js
@@ -230,11 +230,11 @@ class Router {
|
|||||||
cors(config) {
|
cors(config) {
|
||||||
config = config || {}
|
config = config || {}
|
||||||
this.corsConfig = {
|
this.corsConfig = {
|
||||||
allowOrigin: '*',
|
allowOrigin: config.allowOrigin || '*',
|
||||||
allowMethods: '*',
|
allowMethods: config.allowMethods || '*',
|
||||||
allowHeaders: '*',
|
allowHeaders: config.allowHeaders || '*, Authorization',
|
||||||
maxAge: 86400,
|
maxAge: config.maxAge || 86400,
|
||||||
optionsSuccessStatus: 204
|
optionsSuccessStatus: config.optionsSuccessStatus || 204
|
||||||
}
|
}
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user