1
0
mirror of https://github.com/golang/go synced 2024-11-17 16:04:47 -07:00

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.
This commit is contained in:
Aleksandr Dobkinimg src=404 onerror=alert(document.domain) 2022-04-29 17:14:53 -07:00 committed by GitHub
parent f2b674756b
commit 76a39577e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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++ {