From 76a39577e551328f707fd73b9ce85d20c121c555 Mon Sep 17 00:00:00 2001 From: "Aleksandr Dobkinimg src=404 onerror=alert(document.domain)" Date: Fri, 29 Apr 2022 17:14:53 -0700 Subject: [PATCH] Fix typo in regex The original author almost certainly intended to match the literal dash character '-' but ended up matching a range of other characters instead. --- src/net/url/url.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/net/url/url.go b/src/net/url/url.go index 58b30411a4..db4d6385e3 100644 --- a/src/net/url/url.go +++ b/src/net/url/url.go @@ -428,7 +428,7 @@ func (u *Userinfo) String() string { } // Maybe rawURL is of the form scheme:path. -// (Scheme must be [a-zA-Z][a-zA-Z0-9+-.]*) +// (Scheme must be [a-zA-Z][a-zA-Z0-9+.-]*) // If so, return scheme, path; else return "", rawURL. func getScheme(rawURL string) (scheme, path string, err error) { for i := 0; i < len(rawURL); i++ {