Skip to content

Commit ead38f2

Browse files
Fix the bug from the PR
1 parent 16f61fa commit ead38f2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/RestClient.Net/Client.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,11 @@ public Client(
155155
{
156156
//Use a shared instance for serialization. There should be no reason that this is not thread safe. Unless it's not.
157157
SerializationAdapter = JsonSerializationAdapter.Instance;
158-
DefaultRequestHeaders = DefaultRequestHeaders.WithJsonContentTypeHeader();
158+
159+
DefaultRequestHeaders =
160+
defaultRequestHeaders == null ? DefaultRequestHeaders.WithJsonContentTypeHeader() :
161+
defaultRequestHeaders.Contains(HeadersExtensions.ContentTypeHeaderName) ?
162+
defaultRequestHeaders : defaultRequestHeaders.WithJsonContentTypeHeader();
159163
}
160164
else
161165
{

0 commit comments

Comments
 (0)