From f9f5478ca0778d0f64495bb05e19907582326fd1 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 19 Jul 2016 16:44:15 +0200 Subject: Server: Don't make the host url check for client credentials if this is a test instance --- server/controllers/api/v1/users.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'server/controllers/api/v1/users.js') diff --git a/server/controllers/api/v1/users.js b/server/controllers/api/v1/users.js index dde459a73..3f8d8ad92 100644 --- a/server/controllers/api/v1/users.js +++ b/server/controllers/api/v1/users.js @@ -27,7 +27,10 @@ function getAngularClient (req, res, next) { headerHostShouldBe += ':' + serverPort } - if (req.get('host') !== headerHostShouldBe) return res.type('json').status(403).end() + // Don't make this check if this is a test instance + if (process.env.NODE_ENV !== 'test' && req.get('host') !== headerHostShouldBe) { + return res.type('json').status(403).end() + } Client.loadFirstClient(function (err, client) { if (err) return next(err) -- cgit v1.2.3