( headers: IncomingHttpHeaders | undefined )
| 50 | } |
| 51 | |
| 52 | export function extractClientIpAddress( |
| 53 | headers: IncomingHttpHeaders | undefined |
| 54 | ): string | undefined { |
| 55 | const forwardedFor = getFirstHeaderValue(headers, "x-forwarded-for"); |
| 56 | if (!forwardedFor) { |
| 57 | return undefined; |
| 58 | } |
| 59 | |
| 60 | const first = forwardedFor.split(",")[0]?.trim(); |
| 61 | return first?.length ? first : undefined; |
| 62 | } |
| 63 | |
| 64 | export function extractCookieValues( |
| 65 | cookieHeader: string | string[] | undefined, |
no test coverage detected