Skip to content

Commit 3b33253

Browse files
committed
API: only set default content-type when not set
1 parent af82e0f commit 3b33253

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/build/cmd/generate/commands/gensource/generator.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -795,7 +795,7 @@ func (r ` + g.Endpoint.MethodWithNamespace() + `Request) Do(ctx context.Context,
795795
}` + "\n\n")
796796

797797
if g.Endpoint.Body != nil {
798-
g.w(`if r.Body != nil {
798+
g.w(`if r.Body != nil && req.Header.Get(headerContentType) == "" {
799799
req.Header[headerContentType] = headerContentTypeJSON
800800
}` + "\n\n")
801801
}

0 commit comments

Comments
 (0)