Skip to content

Get up and running with Kimi, GLM, MiniMax, DeepSeek, gpt-oss, Qwen, Gemma and other models.

server: lowercase hostname for Host header check (#5851)

frob757eeacc1b34
diff --git a/server/routes.go b/server/routes.go
index 7e8f664b9..593d372e5 100644
--- a/server/routes.go
+++ b/server/routes.go
@@ -1071,11 +1071,13 @@ func isLocalIP(ip netip.Addr) bool {
}
func allowedHost(host string) bool {
+ host = strings.ToLower(host)
+
if host == "" || host == "localhost" {
return true
}
- if hostname, err := os.Hostname(); err == nil && host == hostname {
+ if hostname, err := os.Hostname(); err == nil && host == strings.ToLower(hostname) {
return true
}