aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-07-19 16:44:15 +0200
committerChocobozzz <florian.bigard@gmail.com>2016-07-19 16:44:15 +0200
commitf9f5478ca0778d0f64495bb05e19907582326fd1 (patch)
tree739dc96024f15b09c59b14b387ffd8f83a6d52ab
parent1a42c9e2c0fb64cdbebd81b311736e752f591e0a (diff)
downloadPeerTube-f9f5478ca0778d0f64495bb05e19907582326fd1.tar.gz
PeerTube-f9f5478ca0778d0f64495bb05e19907582326fd1.tar.zst
PeerTube-f9f5478ca0778d0f64495bb05e19907582326fd1.zip
Server: Don't make the host url check for client credentials if this is a test instance
-rw-r--r--server/controllers/api/v1/users.js5
1 files changed, 4 insertions, 1 deletions
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) {
27 headerHostShouldBe += ':' + serverPort 27 headerHostShouldBe += ':' + serverPort
28 } 28 }
29 29
30 if (req.get('host') !== headerHostShouldBe) return res.type('json').status(403).end() 30 // Don't make this check if this is a test instance
31 if (process.env.NODE_ENV !== 'test' && req.get('host') !== headerHostShouldBe) {
32 return res.type('json').status(403).end()
33 }
31 34
32 Client.loadFirstClient(function (err, client) { 35 Client.loadFirstClient(function (err, client) {
33 if (err) return next(err) 36 if (err) return next(err)