projects
/
oweals
/
peertube.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
45cd28b
)
Fix views system behind a proxy
author
Chocobozzz
<me@florianbigard.com>
Wed, 28 Mar 2018 12:51:50 +0000
(14:51 +0200)
committer
Chocobozzz
<me@florianbigard.com>
Wed, 28 Mar 2018 12:51:50 +0000
(14:51 +0200)
server/controllers/api/videos/index.ts
patch
|
blob
|
history
diff --git
a/server/controllers/api/videos/index.ts
b/server/controllers/api/videos/index.ts
index 552e5edac74c08223a07feb3a3394f5ff4af6713..c0a8ac118a22ec569ad4fbd0e0df6e04e5875451 100644
(file)
--- 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) {
async function viewVideo (req: express.Request, res: express.Response) {
const videoInstance = res.locals.video
- const ip = req.ip
+ const ip = req.
headers['x-real-ip'] as string || req.
ip
const exists = await Redis.Instance.isViewExists(ip, videoInstance.uuid)
if (exists) {
logger.debug('View for ip %s and video %s already exists.', ip, videoInstance.uuid)