Skip to content

Node.js based forum software built for the modern web

test: fix test to check for Secure in cookie string if test runner domain is https

Julian Lam5954015ed741
diff --git a/test/controllers.js b/test/controllers.js
index d79cf6de04..62a28c1080 100644
--- a/test/controllers.js
+++ b/test/controllers.js
@@ -639,7 +639,7 @@ describe('Controllers', () => {
});
assert.strictEqual(response.statusCode, 302);
- assert.strictEqual(response.headers['set-cookie'], `express.sid=; Path=${nconf.get('relative_path') || '/'}; Expires=Thu, 01 Jan 1970 00:00:00 GMT; SameSite=Lax`);
+ assert.strictEqual(response.headers['set-cookie'], `express.sid=; Path=${nconf.get('relative_path') || '/'}; Expires=Thu, 01 Jan 1970 00:00:00 GMT${nconf.get('secure') ? '; Secure' : ''}; SameSite=Lax`);
assert.strictEqual(response.headers.location, `${nconf.get('relative_path')}/`);
});