Skip to content

Commit

Permalink
Merge pull request #26 from replicatedhq/user-agent
Browse files Browse the repository at this point in the history
Add useragent header
  • Loading branch information
marccampbell committed Jul 24, 2019
2 parents ad14283 + 93e9592 commit d9990f8
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
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
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 d9990f8

Please sign in to comment.