diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-11-01 19:14:33 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-11-01 19:14:33 +0100 |
commit | b1233aa856d9b7cd18179c96a0a4856d3ab3b319 (patch) | |
tree | a3d43ccf0432926bab6883ecbf34f289827e375d /server/controllers/api | |
parent | 4b08096b2c58f801e5aad19e38d24ec59dd3e14e (diff) | |
download | PeerTube-b1233aa856d9b7cd18179c96a0a4856d3ab3b319.tar.gz PeerTube-b1233aa856d9b7cd18179c96a0a4856d3ab3b319.tar.zst PeerTube-b1233aa856d9b7cd18179c96a0a4856d3ab3b319.zip |
Server: add log messages if the server refuses to serve local clients tokens
Diffstat (limited to 'server/controllers/api')
-rw-r--r-- | server/controllers/api/clients.js | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/server/controllers/api/clients.js b/server/controllers/api/clients.js index b01354195..7755f6c2b 100644 --- a/server/controllers/api/clients.js +++ b/server/controllers/api/clients.js | |||
@@ -4,6 +4,7 @@ const express = require('express') | |||
4 | const mongoose = require('mongoose') | 4 | const mongoose = require('mongoose') |
5 | 5 | ||
6 | const constants = require('../../initializers/constants') | 6 | const constants = require('../../initializers/constants') |
7 | const logger = require('../../helpers/logger') | ||
7 | 8 | ||
8 | const Client = mongoose.model('OAuthClient') | 9 | const Client = mongoose.model('OAuthClient') |
9 | 10 | ||
@@ -22,6 +23,7 @@ function getLocalClient (req, res, next) { | |||
22 | 23 | ||
23 | // Don't make this check if this is a test instance | 24 | // Don't make this check if this is a test instance |
24 | if (process.env.NODE_ENV !== 'test' && req.get('host') !== headerHostShouldBe) { | 25 | if (process.env.NODE_ENV !== 'test' && req.get('host') !== headerHostShouldBe) { |
26 | logger.info('Getting client tokens for host %s is forbidden (expected %s).', req.get('host'), headerHostShouldBe) | ||
25 | return res.type('json').status(403).end() | 27 | return res.type('json').status(403).end() |
26 | } | 28 | } |
27 | 29 | ||