Skip to content

Commit

Permalink
chore: ci
Browse files Browse the repository at this point in the history
  • Loading branch information
shakyShane committed Sep 14, 2016
1 parent 62d83b8 commit fb77d82
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
14 changes: 7 additions & 7 deletions lib/server/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
})
}
Expand Down Expand Up @@ -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();
}
}
Expand Down
8 changes: 4 additions & 4 deletions test/specs/e2e/e2e.options.cors.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
Expand Down

0 comments on commit fb77d82

Please sign in to comment.