".github/vscode:/vscode.git/clone" did not exist on "058f6cd2cc397f4063ae99840b5606385d1f0b5a"
Unverified Commit 757eeacc authored by frob's avatar frob Committed by GitHub
Browse files

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

parent dd42acf7
......@@ -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
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment