Skip to content

Commit

Permalink
Merge pull request #41 from ShikiGami/main
Browse files Browse the repository at this point in the history
Fixing Content-Type bug for HTTP/1.1 POST Unary requests in Unity
  • Loading branch information
mayuki authored Feb 6, 2025
2 parents 96fbc82 + 2d20880 commit 46c1ed8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class UnityWebRequestHttpHandler : HttpMessageHandler
protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage requestMessage, CancellationToken cancellationToken)
{
using var uploadHandler = new UploadHandlerRaw(await requestMessage.Content.ReadAsByteArrayAsync());
uploadHandler.contentType = requestMessage.Headers.Accept.ToString();
uploadHandler.contentType = requestMessage.Content.Headers.ContentType.ToString();

using var downloadHandler = new DownloadHandlerBuffer();
using var webRequest = new UnityWebRequest(requestMessage.RequestUri, requestMessage.Method.ToString(), downloadHandler, uploadHandler);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class UnityWebRequestHttpHandler : HttpMessageHandler
protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage requestMessage, CancellationToken cancellationToken)
{
using var uploadHandler = new UploadHandlerRaw(await requestMessage.Content.ReadAsByteArrayAsync());
uploadHandler.contentType = requestMessage.Headers.Accept.ToString();
uploadHandler.contentType = requestMessage.Content.Headers.ContentType.ToString();

using var downloadHandler = new DownloadHandlerBuffer();
using var webRequest = new UnityWebRequest(requestMessage.RequestUri, requestMessage.Method.ToString(), downloadHandler, uploadHandler);
Expand Down

0 comments on commit 46c1ed8

Please sign in to comment.