diff --git a/cmd/syncthing/gui.go b/cmd/syncthing/gui.go index 45721169..5ad34b0a 100644 --- a/cmd/syncthing/gui.go +++ b/cmd/syncthing/gui.go @@ -1328,7 +1328,7 @@ func addressIsLocalhost(addr string) bool { // There was no port, so we assume the address was just a hostname host = addr } - switch host { + switch strings.ToLower(host) { case "127.0.0.1", "::1", "localhost": return true default: diff --git a/cmd/syncthing/gui_test.go b/cmd/syncthing/gui_test.go index 961e66ca..0b5d4533 100644 --- a/cmd/syncthing/gui_test.go +++ b/cmd/syncthing/gui_test.go @@ -833,9 +833,11 @@ func TestAddressIsLocalhost(t *testing.T) { }{ // These are all valid localhost addresses {"localhost", true}, + {"LOCALHOST", true}, {"::1", true}, {"127.0.0.1", true}, {"localhost:8080", true}, + {"LOCALHOST:8000", true}, {"[::1]:8080", true}, {"127.0.0.1:8080", true},