diff --git a/cmd/crowdsec-cli/main.go b/cmd/crowdsec-cli/main.go index 71c1ce753..057df3f28 100644 --- a/cmd/crowdsec-cli/main.go +++ b/cmd/crowdsec-cli/main.go @@ -123,7 +123,7 @@ API interaction: rootCmd.PersistentFlags().BoolVar(&wrn_lvl, "warning", false, "Set logging to warning.") rootCmd.PersistentFlags().BoolVar(&err_lvl, "error", false, "Set logging to error.") - rootCmd.PersistentFlags().StringVar(&cwhub.HubBranch, "branch", "", "Override hub branch on github") + rootCmd.PersistentFlags().StringVar(&cwhub.HubBranch, "branch", "master", "Override hub branch on github") if err := rootCmd.PersistentFlags().MarkHidden("branch"); err != nil { log.Fatalf("failed to make branch hidden : %s", err) } diff --git a/pkg/cwhub/download.go b/pkg/cwhub/download.go index 194539998..dc8773cfb 100644 --- a/pkg/cwhub/download.go +++ b/pkg/cwhub/download.go @@ -148,7 +148,8 @@ func DownloadItem(target Item, tdir string, overwrite bool, dataFolder string) ( } //log.Infof("Downloading %s to %s", target.Name, tdir) - req, err := http.NewRequest("GET", fmt.Sprintf(RawFileURLTemplate, HubBranch, target.RemotePath), nil) + uri := fmt.Sprintf(RawFileURLTemplate, HubBranch, target.RemotePath) + req, err := http.NewRequest("GET", uri, nil) if err != nil { log.Errorf("%s : request creation failed : %s", target.Name, err) return target, err @@ -159,7 +160,7 @@ func DownloadItem(target Item, tdir string, overwrite bool, dataFolder string) ( return target, err } if resp.StatusCode != 200 { - log.Errorf("%s : non 200 response : %d", target.Name, resp.StatusCode) + log.Errorf("%s : We got an error reaching %s : %d", target.Name, uri, resp.StatusCode) return target, fmt.Errorf("bad http code") } defer resp.Body.Close()