From 110cdd171e2abe05486d2f16f89466866203eb3d Mon Sep 17 00:00:00 2001 From: Evert Prants Date: Mon, 13 May 2019 14:54:37 +0300 Subject: [PATCH] lets try this --- applications/tempfiles/index.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/applications/tempfiles/index.js b/applications/tempfiles/index.js index be5d690..443a121 100644 --- a/applications/tempfiles/index.js +++ b/applications/tempfiles/index.js @@ -46,6 +46,7 @@ async function init () { }) router.post('/publish', async (req, res, next) => { + let ip = req.ip let token = req.header('token') || req.body.token if (!token || !config.tokens[token]) return res.status(402).send('Forbidden') @@ -63,14 +64,6 @@ async function init () { if (!allFiles.length) return res.status(400).send('Invalid request') - // Determine real IP address - let ip - if (req.header('x-forwarded-for')) { - ip = req.header('x-forwarded-for') - } else { - ip = req.connection.remoteAddress - } - console.log('[%s] from %s request to upload %d file(s)', new Date(), ip, allFiles.length) // Handle all files provided