projects
/
oweals
/
peertube.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1a42c9e
)
Server: Don't make the host url check for client credentials if this is a test instance
author
Chocobozzz
<florian.bigard@gmail.com>
Tue, 19 Jul 2016 14:44:15 +0000
(16:44 +0200)
committer
Chocobozzz
<florian.bigard@gmail.com>
Tue, 19 Jul 2016 14:44:15 +0000
(16:44 +0200)
server/controllers/api/v1/users.js
patch
|
blob
|
history
diff --git
a/server/controllers/api/v1/users.js
b/server/controllers/api/v1/users.js
index dde459a73e40a2bd79d63c4f375e817680416cc2..3f8d8ad92e4974567ebb433ca75bd46190cbaacd 100644
(file)
--- 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)