Skip to content

Commit

Permalink
update syslog middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
ngoerlitz committed Aug 27, 2023
1 parent bfbef01 commit e72e2fd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/Application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ initializeApplication()
application.use(bodyParser.json());
application.use(fileUpload({ debug: Config.APP_DEBUG, useTempFiles: true, tempFileDir: Config.FILE_TMP_LOCATION }));

application.set("trust proxy", ["loopback", "172.16.0.201"]);

// Start listening
application.listen(Config.APP_PORT, Config.APP_HOST ?? "127.0.0.1", () => {
Logger.log(LogLevels.LOG_WARN, `Debug mode: ${Config.APP_DEBUG ? "ENABLED" : "DISABLED"}`);
Expand Down
2 changes: 1 addition & 1 deletion src/middlewares/SyslogMiddleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export async function syslogMiddleware(request: Request, response: Response, nex
await SysLog.create({
path: request.url,
method: request.method,
remote_addr: request.socket.remoteAddress,
remote_addr: request.ip,
user_id: uid === 0 ? null : uid.toString(),
});

Expand Down

0 comments on commit e72e2fd

Please sign in to comment.