Skip to content

Commit 6c13157

Browse files
author
Pavlo Kulyk
committed
fix: streamline client IP retrieval in AdminForthRestAPI
1 parent 6743320 commit 6c13157

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

adminforth/modules/restApi.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,8 +380,7 @@ export default class AdminForthRestAPI implements IAdminForthRestAPI {
380380
if (username === 'adminforth') {
381381
defaultUserExists = true;
382382
}
383-
const headers = response.getHeaders?.() || {};
384-
const clientIp = this.adminforth.auth.getClientIp(headers);
383+
const clientIp = this.adminforth.auth.getClientIp(response.getHeaders?.() || {});
385384
const isPrivateIP = clientIp === null ? true : false;
386385

387386
const publicPart = {

0 commit comments

Comments
 (0)