diff options
author | Chocobozzz <me@florianbigard.com> | 2018-03-29 10:58:24 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-03-29 11:03:30 +0200 |
commit | 490b595a01c5824ff63ffb87f0efdfca95f4bf3b (patch) | |
tree | 3ad716fbb97a8b4ee946ad907202b82934a33d7c /server/controllers/api/videos | |
parent | 23f4c3d412974fa5fda52589d1192e098e260f1a (diff) | |
download | PeerTube-490b595a01c5824ff63ffb87f0efdfca95f4bf3b.tar.gz PeerTube-490b595a01c5824ff63ffb87f0efdfca95f4bf3b.tar.zst PeerTube-490b595a01c5824ff63ffb87f0efdfca95f4bf3b.zip |
Prevent brute force login attack
Diffstat (limited to 'server/controllers/api/videos')
-rw-r--r-- | server/controllers/api/videos/index.ts | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/server/controllers/api/videos/index.ts b/server/controllers/api/videos/index.ts index c0a8ac118..552e5edac 100644 --- a/server/controllers/api/videos/index.ts +++ b/server/controllers/api/videos/index.ts | |||
@@ -353,7 +353,7 @@ function getVideo (req: express.Request, res: express.Response) { | |||
353 | async function viewVideo (req: express.Request, res: express.Response) { | 353 | async function viewVideo (req: express.Request, res: express.Response) { |
354 | const videoInstance = res.locals.video | 354 | const videoInstance = res.locals.video |
355 | 355 | ||
356 | const ip = req.headers['x-real-ip'] as string || req.ip | 356 | const ip = req.ip |
357 | const exists = await Redis.Instance.isViewExists(ip, videoInstance.uuid) | 357 | const exists = await Redis.Instance.isViewExists(ip, videoInstance.uuid) |
358 | if (exists) { | 358 | if (exists) { |
359 | logger.debug('View for ip %s and video %s already exists.', ip, videoInstance.uuid) | 359 | logger.debug('View for ip %s and video %s already exists.', ip, videoInstance.uuid) |