diff --git a/lfsapi/client.go b/lfsapi/client.go index 5e1733dc..641a255c 100644 --- a/lfsapi/client.go +++ b/lfsapi/client.go @@ -46,7 +46,8 @@ func (c *Client) NewRequest(method string, e Endpoint, suffix string, body inter } if !httpRE.MatchString(prefix) { - return nil, fmt.Errorf("missing protocol: %q", prefix) + urlfragment := strings.SplitN(prefix, "?", 2)[0] + return nil, fmt.Errorf("missing protocol: %q", urlfragment) } req, err := http.NewRequest(method, joinURL(prefix, suffix), nil) diff --git a/tq/adapterbase.go b/tq/adapterbase.go index 393dbdf0..db461737 100644 --- a/tq/adapterbase.go +++ b/tq/adapterbase.go @@ -4,6 +4,7 @@ import ( "fmt" "net/http" "regexp" + "strings" "sync" "github.com/git-lfs/git-lfs/lfsapi" @@ -190,7 +191,8 @@ var httpRE = regexp.MustCompile(`\Ahttps?://`) func (a *adapterBase) newHTTPRequest(method string, rel *Action) (*http.Request, error) { if !httpRE.MatchString(rel.Href) { - return nil, fmt.Errorf("missing protocol: %q", rel.Href) + urlfragment := strings.SplitN(rel.Href, "?", 2)[0] + return nil, fmt.Errorf("missing protocol: %q", urlfragment) } req, err := http.NewRequest(method, rel.Href, nil)