http: use string contains instead of index

This commit is contained in:
albertony 2022-01-23 22:55:37 +01:00
parent 162aba60eb
commit 946e84d194

View file

@ -297,7 +297,7 @@ func parseName(base *url.URL, name string) (string, error) {
} }
// check it doesn't have URL parameters // check it doesn't have URL parameters
uStr := u.String() uStr := u.String()
if strings.Index(uStr, "?") >= 0 { if strings.Contains(uStr, "?") {
return "", errFoundQuestionMark return "", errFoundQuestionMark
} }
// check that this is going back to the same host and scheme // check that this is going back to the same host and scheme