From 9264f705a631f5618ffeadb99d1b2ebfad799f2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Jagodzi=C5=84ski?= Date: Tue, 4 Feb 2020 17:53:37 +0100 Subject: [PATCH] The getClientIp can return null (#41902) As you can see in the source code here https://github.com/pbojinov/request-ip/blob/master/src/index.js#L129 the `getClientIp` function can return `null` value if all the possible methods fail. --- types/request-ip/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/request-ip/index.d.ts b/types/request-ip/index.d.ts index e86ca3fe90..9658b198e3 100644 --- a/types/request-ip/index.d.ts +++ b/types/request-ip/index.d.ts @@ -38,7 +38,7 @@ interface Options { attributeName: string; } -export declare function getClientIp(req: Request): string; +export declare function getClientIp(req: Request): string | null; export function mw(options?: Options): (req: Request, res: any, next: any) => any;