From fb77d82a6f426ae382eae2a92eaf7e956296ac6b Mon Sep 17 00:00:00 2001 From: Shane Osbourne Date: Wed, 14 Sep 2016 21:11:56 +0100 Subject: [PATCH] chore: ci --- lib/server/utils.js | 14 +++++++------- test/specs/e2e/e2e.options.cors.js | 8 ++++---- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/server/utils.js b/lib/server/utils.js index 99bb90c1b..56e86a080 100644 --- a/lib/server/utils.js +++ b/lib/server/utils.js @@ -71,10 +71,10 @@ var utils = { } ]; - if (options.get('cors')) { + if (options.get("cors")) { defaultMiddlewares.unshift({ - id: 'Browsersync CORS support', - route: '', + id: "Browsersync CORS support", + route: "", handle: utils.getCorsMiddlewware() }) } @@ -133,17 +133,17 @@ var utils = { return function (req, res, next) { // Website you wish to allow to connect - res.setHeader('Access-Control-Allow-Origin', '*'); + res.setHeader("Access-Control-Allow-Origin", "*"); // Request methods you wish to allow - res.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS, PUT, PATCH, DELETE'); + res.setHeader("Access-Control-Allow-Methods", "GET, POST, OPTIONS, PUT, PATCH, DELETE"); // Request headers you wish to allow - res.setHeader('Access-Control-Allow-Headers', 'X-Requested-With,content-type'); + res.setHeader("Access-Control-Allow-Headers", "X-Requested-With,content-type"); // Set to true if you need the website to include cookies in the requests sent // to the API (e.g. in case you use sessions) - res.setHeader('Access-Control-Allow-Credentials', true); + res.setHeader("Access-Control-Allow-Credentials", true); next(); } } diff --git a/test/specs/e2e/e2e.options.cors.js b/test/specs/e2e/e2e.options.cors.js index acbb99710..ec4e24285 100644 --- a/test/specs/e2e/e2e.options.cors.js +++ b/test/specs/e2e/e2e.options.cors.js @@ -22,10 +22,10 @@ describe("e2e options test (cors)", function () { .get("/index.html") .expect(200) .end(function (err, res) { - assert.equal(res.headers['access-control-allow-origin'], '*'); - assert.equal(res.headers['access-control-allow-methods'], 'GET, POST, OPTIONS, PUT, PATCH, DELETE'); - assert.equal(res.headers['access-control-allow-headers'], 'X-Requested-With,content-type'); - assert.equal(res.headers['access-control-allow-credentials'], 'true'); + assert.equal(res.headers["access-control-allow-origin"], "*"); + assert.equal(res.headers["access-control-allow-methods"], "GET, POST, OPTIONS, PUT, PATCH, DELETE"); + assert.equal(res.headers["access-control-allow-headers"], "X-Requested-With,content-type"); + assert.equal(res.headers["access-control-allow-credentials"], "true"); bs.cleanup(); done(); });