mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-07-31 19:20:25 +00:00
allow OPTIONS, req.headers.origin || *
This commit is contained in:
parent
75c1a38beb
commit
8cbf777232
1 changed files with 3 additions and 2 deletions
|
|
@ -15,7 +15,8 @@ module.exports.view = (req, res, next) ->
|
|||
|
||||
#CORS middleware
|
||||
module.exports.allowCrossDomain = (req, res, next) ->
|
||||
res.header "Access-Control-Allow-Origin", '*'
|
||||
res.header "Access-Control-Allow-Methods", "GET,PUT,POST,DELETE"
|
||||
console.log req.headers.origin
|
||||
res.header "Access-Control-Allow-Origin", (req.headers.origin || "*")
|
||||
res.header "Access-Control-Allow-Methods", "OPTIONS,GET,PUT,POST,DELETE"
|
||||
res.header "Access-Control-Allow-Headers", "Content-Type,x-requested-with,x-api-user,x-api-key"
|
||||
next()
|
||||
Loading…
Reference in a new issue