From 68dc232a6edb138c0bde17e6955cbce90677c825 Mon Sep 17 00:00:00 2001 From: Linus Kendall Date: Sat, 3 Sep 2022 10:26:44 +0100 Subject: [PATCH] Hardcode http scheme in fetcher --- internal/cmd/fetch/fetch.go | 3 ++- internal/fetch/sidecar.go | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/cmd/fetch/fetch.go b/internal/cmd/fetch/fetch.go index 296f162..73f082c 100644 --- a/internal/cmd/fetch/fetch.go +++ b/internal/cmd/fetch/fetch.go @@ -139,7 +139,8 @@ func run() { err := sidecarClient.DownloadSnapshotFile(ctx, ".", file_.FileName) if err != nil { log.Error("Download failed", - zap.String("snapshot", file_.FileName)) + zap.String("snapshot", file_.FileName), + zap.String("error", err.Error())) } return err }) diff --git a/internal/fetch/sidecar.go b/internal/fetch/sidecar.go index 90e1d11..b8d186c 100644 --- a/internal/fetch/sidecar.go +++ b/internal/fetch/sidecar.go @@ -90,7 +90,7 @@ func (c *SidecarClient) ListSnapshots(ctx context.Context) (infos []*types.Snaps // The returned response is guaranteed to have a valid ContentLength. // The caller has the responsibility to close the response body even if the error is not nil. func (c *SidecarClient) StreamSnapshot(ctx context.Context, name string) (res *http.Response, err error) { - snapURL := c.resty.HostURL + "/v1/snapshot/" + url.PathEscape(name) + snapURL := "http://" + c.resty.HostURL + "/v1/snapshot/" + url.PathEscape(name) // TODO: Don't hardcode scheme c.log.Info("Downloading snapshot", zap.String("snapshot_url", snapURL)) req, err := http.NewRequestWithContext(ctx, http.MethodGet, snapURL, nil) if err != nil {