aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-11-01 19:14:33 +0100
committerChocobozzz <florian.bigard@gmail.com>2016-11-01 19:14:33 +0100
commitb1233aa856d9b7cd18179c96a0a4856d3ab3b319 (patch)
treea3d43ccf0432926bab6883ecbf34f289827e375d
parent4b08096b2c58f801e5aad19e38d24ec59dd3e14e (diff)
downloadPeerTube-b1233aa856d9b7cd18179c96a0a4856d3ab3b319.tar.gz
PeerTube-b1233aa856d9b7cd18179c96a0a4856d3ab3b319.tar.zst
PeerTube-b1233aa856d9b7cd18179c96a0a4856d3ab3b319.zip
Server: add log messages if the server refuses to serve local clients tokens
-rw-r--r--server/controllers/api/clients.js2
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')
4const mongoose = require('mongoose') 4const mongoose = require('mongoose')
5 5
6const constants = require('../../initializers/constants') 6const constants = require('../../initializers/constants')
7const logger = require('../../helpers/logger')
7 8
8const Client = mongoose.model('OAuthClient') 9const 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