Skip to content

Commit

Permalink
Hardcode http scheme in fetcher
Browse files Browse the repository at this point in the history
linuskendall committed Sep 3, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent b768dad commit 68dc232
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion internal/cmd/fetch/fetch.go
Original file line number Diff line number Diff line change
@@ -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
})
2 changes: 1 addition & 1 deletion internal/fetch/sidecar.go
Original file line number Diff line number Diff line change
@@ -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 {

0 comments on commit 68dc232

Please sign in to comment.