Skip to content

Commit d4fd061

Browse files
jeanbzajba
authored andcommitted
internal/worker: don't require https index URLs
Sometimes the golang index has a good reason to have an http address: - It's running locally on your dev machine. - It's running in production, but on a network-local address. This removes the https requirement that we have to patch in at the moment. Change-Id: Ib6577a63463c5b2e7cc537532a9ca20ac63fd1d4 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/685456 Reviewed-by: Jonathan Amsterdam <[email protected]> Reviewed-by: Carlos Amedee <[email protected]> kokoro-CI: kokoro <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
1 parent 5832fae commit d4fd061

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

internal/index/index.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,13 @@ type Client struct {
3131
}
3232

3333
// New constructs a *Client using the provided rawurl, which is expected to
34-
// be an absolute URI that can be directly passed to http.Get.
34+
// be able to be passed to http.Get.
3535
func New(rawurl string) (_ *Client, err error) {
3636
defer derrors.Add(&err, "index.New(%q)", rawurl)
3737

38-
u, err := url.Parse(rawurl)
39-
if err != nil {
38+
if _, err := url.Parse(rawurl); err != nil {
4039
return nil, fmt.Errorf("url.Parse(%q): %v", rawurl, err)
4140
}
42-
if u.Scheme != "https" {
43-
return nil, fmt.Errorf("scheme must be https (got %s)", u.Scheme)
44-
}
4541
return &Client{url: strings.TrimRight(rawurl, "/"), httpClient: &http.Client{Transport: &ochttp.Transport{}}}, nil
4642
}
4743

0 commit comments

Comments
 (0)