Commit 707b5f76 authored by Vadym Gidulian's avatar Vadym Gidulian

Added responding w/ 204 for all OPTIONS requests

parent 646daae7
...@@ -20,6 +20,9 @@ app.use((req, res, next) => { ...@@ -20,6 +20,9 @@ app.use((req, res, next) => {
res.header('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Accept, Content-Type'); res.header('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Accept, Content-Type');
res.header('Access-Control-Allow-Methods', 'OPTIONS, HEAD, GET'); res.header('Access-Control-Allow-Methods', 'OPTIONS, HEAD, GET');
res.header('Access-Control-Expose-Headers', 'Content-Length'); res.header('Access-Control-Expose-Headers', 'Content-Length');
if (req.method === 'OPTIONS') return res.send(204);
next(); next();
}); });
app.use(responseTime()); app.use(responseTime());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment