Skip to content

Commit

Permalink
Prefer empty value over something saying it is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
shackra committed Oct 31, 2024
1 parent 2fcff4a commit 9536b7e
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions pkg/uhttp/wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,6 @@ func NewBaseHttpClientWithContext(ctx context.Context, httpClient *http.Client,
func WithJSONResponse(response interface{}) DoOption {
return func(resp *WrapperResponse) error {
contentHeader := resp.Header.Get(ContentType)
if contentHeader == "" {
// for some reason there was no header for content-type
contentHeader = "custom-mime/empty"
}

if !IsJSONContentType(contentHeader) {
if len(resp.Body) != 0 {
Expand Down

0 comments on commit 9536b7e

Please sign in to comment.