From: Chocobozzz Date: Tue, 1 Nov 2016 18:14:33 +0000 (+0100) Subject: Server: add log messages if the server refuses to serve local clients tokens X-Git-Tag: v0.0.1-alpha~652 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b1233aa856d9b7cd18179c96a0a4856d3ab3b319;p=oweals%2Fpeertube.git Server: add log messages if the server refuses to serve local clients tokens --- 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') const mongoose = require('mongoose') const constants = require('../../initializers/constants') +const logger = require('../../helpers/logger') const Client = mongoose.model('OAuthClient') @@ -22,6 +23,7 @@ function getLocalClient (req, res, next) { // Don't make this check if this is a test instance if (process.env.NODE_ENV !== 'test' && req.get('host') !== headerHostShouldBe) { + logger.info('Getting client tokens for host %s is forbidden (expected %s).', req.get('host'), headerHostShouldBe) return res.type('json').status(403).end() }