fix: harden tailscale serve auth

This commit is contained in:
Peter Steinberger
2026-01-26 12:47:53 +00:00
parent 6859e1e6a6
commit fd9be79be1
10 changed files with 189 additions and 29 deletions

View File

@@ -36,7 +36,7 @@ function stripOptionalPort(ip: string): string {
return ip;
}
function parseForwardedForClientIp(forwardedFor?: string): string | undefined {
export function parseForwardedForClientIp(forwardedFor?: string): string | undefined {
const raw = forwardedFor?.split(",")[0]?.trim();
if (!raw) return undefined;
return normalizeIp(stripOptionalPort(raw));