From fe833695190da98301b0e6676307b05070bc493c Mon Sep 17 00:00:00 2001 From: AntonPuko Date: Fri, 25 Nov 2016 18:34:25 +0200 Subject: [PATCH] add editorConfig --- .editorconfig | 7 +++++++ src/main.js | 18 +++++++++--------- 2 files changed, 16 insertions(+), 9 deletions(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..d4eed840 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,7 @@ +root = true + +[*] +end_of_line = lf +insert_final_newline = false +indent_style = space +indent_size = 2 diff --git a/src/main.js b/src/main.js index 0f980518..6b6bfa4e 100644 --- a/src/main.js +++ b/src/main.js @@ -45,15 +45,15 @@ var oauth = OAuthServer({ }); var set_cors_headers = function (req, res, next) { - if ('OPTIONS' === req.method) { - res.set({ - 'Access-Control-Allow-Origin': '*', - 'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, OPTIONS', - 'Access-Control-Allow-Headers': 'X-Requested-With, Content-Type, Accept, Authorization', - 'Access-Control-Max-Age': 300 - }); - return res.send(204); - } + if ('OPTIONS' === req.method) { + res.set({ + 'Access-Control-Allow-Origin': '*', + 'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, OPTIONS', + 'Access-Control-Allow-Headers': 'X-Requested-With, Content-Type, Accept, Authorization', + 'Access-Control-Max-Age': 300 + }); + return res.send(204); + } else { res.set({'Access-Control-Allow-Origin': '*'}); next();