mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 11:41:24 +00:00
fix(gateway): preserve unbracketed IPv6 host headers
This commit is contained in:
@@ -40,6 +40,10 @@ export function resolveHostName(hostHeader?: string): string {
|
||||
return host.slice(1, end);
|
||||
}
|
||||
}
|
||||
// Unbracketed IPv6 host (e.g. "::1") has no port and should be returned as-is.
|
||||
if (net.isIP(host) === 6) {
|
||||
return host;
|
||||
}
|
||||
const [name] = host.split(":");
|
||||
return name ?? "";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user