Skip to content

Node.js based forum software built for the modern web

set origin header to url

Barış Soner Uşaklı743f758f75fc
diff --git a/test/helpers/index.js b/test/helpers/index.js
index edae035b66..a0624a69d6 100644
--- a/test/helpers/index.js
+++ b/test/helpers/index.js
@@ -40,6 +40,7 @@ helpers.loginUser = function (username, password, callback) {
this.open = function () {
stdOpen.apply(this, arguments);
this.setRequestHeader('Cookie', res.headers['set-cookie'][0].split(';')[0]);
+ this.setRequestHeader('Origin', nconf.get('url'));
};
};
@@ -74,6 +75,7 @@ helpers.initSocketIO = function (callback) {
this.open = function () {
stdOpen.apply(this, arguments);
this.setRequestHeader('Cookie', res.headers['set-cookie'][0].split(';')[0]);
+ this.setRequestHeader('Origin', nconf.get('url'));
};
};
diff --git a/test/socket.io.js b/test/socket.io.js
index ac8170225c..4182522b2b 100644
--- a/test/socket.io.js
+++ b/test/socket.io.js
@@ -75,6 +75,7 @@ describe('socket.io', function () {
this.open = function () {
stdOpen.apply(this, arguments);
this.setRequestHeader('Cookie', res.headers['set-cookie'][0].split(';')[0]);
+ this.setRequestHeader('Origin', nconf.get('url'));
};
};