diff --git a/client/client.go b/client/client.go index c8709b09b2..7468948ba5 100644 --- a/client/client.go +++ b/client/client.go @@ -117,7 +117,9 @@ func (c *Client) createRequest(ctx context.Context, method string, url string, m return nil, errors.New("url is missing") } - mutators = append(mutators, request.NewHeaderMutator("User-Agent", c.userAgent)) + if c.userAgent != "" { + mutators = append(mutators, request.NewHeaderMutator("User-Agent", c.userAgent)) + } var body io.Reader if requestBody != nil { diff --git a/client/config.go b/client/config.go index f5e237dc7c..528f1b7f9a 100644 --- a/client/config.go +++ b/client/config.go @@ -28,9 +28,6 @@ func (c *Config) Validate() error { } else if _, err := url.Parse(c.Address); err != nil { return errors.New("address is invalid") } - if c.UserAgent == "" { - return errors.New("user agent is missing") - } return nil } diff --git a/client/config_test.go b/client/config_test.go index fa0e4c3ff7..1a84ff6064 100644 --- a/client/config_test.go +++ b/client/config_test.go @@ -89,11 +89,6 @@ var _ = Describe("Config", func() { Expect(cfg.Validate()).To(MatchError("address is invalid")) }) - It("returns an error if the user agent is missing", func() { - cfg.UserAgent = "" - Expect(cfg.Validate()).To(MatchError("user agent is missing")) - }) - It("returns success", func() { Expect(cfg.Validate()).To(Succeed()) Expect(cfg.Address).To(Equal(address))