I\'m not able to correctly handle CORS issues when doing either PATCH
/POST
/PUT
requests from the browser sending an Authorization
I faced a similar problem and the problem was solved byadding the header to the routes as follows:
"routes": [
{
"src": ".*",
"methods": ["GET", "POST", "OPTIONS"],
"headers": {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Headers": "Origin, X-Requested-With, Content-Type, Accept",
"Access-Control-Allow-Credentials": "true"
},
"dest": "index.js",
"continue": true
},
{
"src": "/user/login", "methods": ["POST"], "dest": "index.js"
}
]
remember to add continue: true
.
https://github.com/super-h-alt/zeit-now-cors-problems/blob/master/now.json