Skip to content

Commit 29bb35e

Browse files
committed
cmd/go: RFC 8989 says that file-URL host comparison is case-insensitive
1 parent 1644917 commit 29bb35e

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

src/cmd/go/internal/web/url_other.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,11 @@ package web
99
import (
1010
"errors"
1111
"path/filepath"
12+
"strings"
1213
)
1314

1415
func convertFileURLPath(host, path string) (string, error) {
15-
switch host {
16-
case "", "localhost":
17-
default:
16+
if host != "" && strings.EqualFold(host, "localhost") {
1817
return "", errors.New("file URL specifies non-local host")
1918
}
2019
return filepath.FromSlash(path), nil

0 commit comments

Comments
 (0)