Skip to content

Commit

Permalink
allow content-type to not be set
Browse files Browse the repository at this point in the history
  • Loading branch information
catriona-m committed Aug 16, 2023
1 parent 18a3d8b commit 4f62d90
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
5 changes: 4 additions & 1 deletion sdk/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,10 @@ func (c *Client) NewRequest(ctx context.Context, input RequestOptions) (*Request
req.Method = input.HttpMethod

req.Header = make(http.Header)
req.Header.Add("Content-Type", input.ContentType)

if input.ContentType != "" {
req.Header.Add("Content-Type", input.ContentType)
}

if c.UserAgent != "" {
req.Header.Add("User-Agent", c.UserAgent)
Expand Down
3 changes: 0 additions & 3 deletions sdk/client/request_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ type RequestOptions struct {
}

func (ro RequestOptions) Validate() error {
if ro.ContentType == "" {
return fmt.Errorf("missing `ContentType`")
}
if len(ro.ExpectedStatusCodes) == 0 {
return fmt.Errorf("missing `ExpectedStatusCodes`")
}
Expand Down

0 comments on commit 4f62d90

Please sign in to comment.