diff options
author | Chocobozzz <me@florianbigard.com> | 2018-03-28 14:51:50 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-03-28 14:51:50 +0200 |
commit | e33e7fc89e4f0e2fbd1d7e87a4e2a2d5aae94f29 (patch) | |
tree | 3cb47468a3d135ce6382e52706ffa573d2847449 /server/controllers | |
parent | 45cd28b679d3472392ed5d77dcfd8f442d1565bf (diff) | |
download | PeerTube-e33e7fc89e4f0e2fbd1d7e87a4e2a2d5aae94f29.tar.gz PeerTube-e33e7fc89e4f0e2fbd1d7e87a4e2a2d5aae94f29.tar.zst PeerTube-e33e7fc89e4f0e2fbd1d7e87a4e2a2d5aae94f29.zip |
Fix views system behind a proxy
Diffstat (limited to 'server/controllers')
-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 552e5edac..c0a8ac118 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.ip | 356 | const ip = req.headers['x-real-ip'] as string || 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) |