Skip to content

Commit

Permalink
Add useragent header
Browse files Browse the repository at this point in the history
  • Loading branch information
marccampbell committed Jul 24, 2019
1 parent ad14283 commit 93e9592
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion cmd/preflight/cli/run_nocrd.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,12 @@ func runPreflightsNoCRD(v *viper.Viper, arg string) error {

preflightContent = string(b)
} else {
resp, err := http.Get(arg)
req, err := http.NewRequest("GET", arg, nil)
if err != nil {
return err
}
req.Header.Set("User-Agent", "Replicated_Preflight/v1beta1")
resp, err := http.DefaultClient.Do(req)
if err != nil {
return err
}
Expand Down
7 changes: 6 additions & 1 deletion cmd/troubleshoot/cli/run_nocrd.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@ func runTroubleshootNoCRD(v *viper.Viper, arg string) error {

collectorContent = string(b)
} else {
resp, err := http.Get(arg)
req, err := http.NewRequest("GET", arg, nil)
if err != nil {
return err
}
req.Header.Set("User-Agent", "Replicated_Troubleshoot/v1beta1")
resp, err := http.DefaultClient.Do(req)
if err != nil {
return err
}
Expand Down

0 comments on commit 93e9592

Please sign in to comment.