Don't handle filenames with a colon in it as http(s) url

This commit is contained in:
Nicolas Martin 2020-10-15 01:58:04 +02:00 committed by Christian Muehlhaeuser
parent 30d37a1eeb
commit 7f359969b7

View file

@ -73,7 +73,7 @@ func sourceFromArg(arg string) (*source, error) {
}
// HTTP(S) URLs:
if u, err := url.ParseRequestURI(arg); err == nil {
if u, err := url.ParseRequestURI(arg); err == nil && strings.Contains(arg, "://") {
if u.Scheme != "" {
if u.Scheme != "http" && u.Scheme != "https" {
return nil, fmt.Errorf("%s is not a supported protocol", u.Scheme)