Skip to content

Commit cb0f5d8

Browse files
committed
Don't rely on HttpClient to parse the Content Type, fixes #92, #102
1 parent 6e221f3 commit cb0f5d8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/ModernHttpClient/Android/OkHttpNetworkHandler.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage
6868
var body = default(RequestBody);
6969
if (request.Content != null) {
7070
var bytes = await request.Content.ReadAsByteArrayAsync().ConfigureAwait(false);
71-
body = RequestBody.Create(MediaType.Parse(request.Content.Headers.ContentType.MediaType), bytes);
71+
72+
var contentType = String.Join (" ", request.Content.Headers.GetValues ("Content-Type"));
73+
body = RequestBody.Create(MediaType.Parse(contentType), bytes);
7274
}
7375

7476
var builder = new Request.Builder()

0 commit comments

Comments
 (0)