summary refs log tree commit diff
path: root/src/api/util/utility/ipAddress.ts
diff options
context:
space:
mode:
authorCatalan Lover <48515417+FSG-Cat@users.noreply.github.com>2022-08-24 22:21:07 +0200
committerGitHub <noreply@github.com>2022-08-24 22:21:07 +0200
commit8abee23ca809c715fbcbd50eacabff028edd69ed (patch)
tree393be1820fcbfc2afec343efcfccf4c553b586b9 /src/api/util/utility/ipAddress.ts
parentAdded Env and Software Vars. (diff)
parentMerge pull request #799 from MaddyUnderStars/feat/captchaVerify (diff)
downloadserver-8abee23ca809c715fbcbd50eacabff028edd69ed.tar.xz
Merge branch 'fosscord:staging' into Bug-Report-Template
Diffstat (limited to 'src/api/util/utility/ipAddress.ts')
-rw-r--r--src/api/util/utility/ipAddress.ts6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/api/util/utility/ipAddress.ts b/src/api/util/utility/ipAddress.ts

index 8d986b26..c96feb9e 100644 --- a/src/api/util/utility/ipAddress.ts +++ b/src/api/util/utility/ipAddress.ts
@@ -78,7 +78,11 @@ export function isProxy(data: typeof exampleData) { export function getIpAdress(req: Request): string { // @ts-ignore - return req.headers[Config.get().security.forwadedFor] || req.socket.remoteAddress; + return ( + req.headers[Config.get().security.forwadedFor as string] || + req.headers[Config.get().security.forwadedFor?.toLowerCase() as string] || + req.socket.remoteAddress + ); } export function distanceBetweenLocations(loc1: any, loc2: any): number {