MCPcopy Index your code
hub / github.com/coder/mux / normalizeIpAddress

Function normalizeIpAddress

src/node/services/serverAuthService.ts:120–132  ·  view source on GitHub ↗
(ipAddress: string | undefined)

Source from the content-addressed store, hash-verified

118}
119
120function normalizeIpAddress(ipAddress: string | undefined): string | undefined {
121 const normalized = normalizeOptionalString(ipAddress);
122 if (!normalized) {
123 return undefined;
124 }
125
126 // Node may normalize IPv4 loopback as IPv6-mapped form.
127 if (normalized === "::ffff:127.0.0.1") {
128 return "127.0.0.1";
129 }
130
131 return normalized;
132}
133
134function detectBrowserFromUserAgent(userAgent: string): string | undefined {
135 const lowerUserAgent = userAgent.toLowerCase();

Callers 3

validateSessionTokenMethod · 0.85
createSessionLockedMethod · 0.85

Calls 1

normalizeOptionalStringFunction · 0.70

Tested by

no test coverage detected