From 9e1ceda9e659b2ea0f40f143b29dedd6ba2d6bb2 Mon Sep 17 00:00:00 2001 From: Jose Date: Sat, 22 Aug 2020 21:14:12 -0500 Subject: [PATCH] Use RequestIP to keep track of uploaders' IPs This is mostly done as a security measure in the even that a foul being uploads content to this image bin that needs to be investigated by the police / FBI later. Honestly I don't think this'll happen but better safe than sorry. --- src/app.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/app.ts b/src/app.ts index 9c74638..91af516 100644 --- a/src/app.ts +++ b/src/app.ts @@ -6,12 +6,14 @@ import mongoose from 'mongoose' import multer from 'multer' import path from 'path' import * as routes from './app/routes' +import {mw as RipMw} from 'request-ip' config() const init = async () => { const app = express() + app.use(RipMw()) app.use(json()) app.use(urlencoded({ extended: true