Skip to content

Commit

Permalink
Set ExpectCompute based on the length of the payload
Browse files Browse the repository at this point in the history
  • Loading branch information
reversefold committed Jan 16, 2025
1 parent 4ac1d53 commit 2715277
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/BizHawk.Client.Common/Api/HttpCommunication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,14 @@ public string ExecPost(string url = null, string payload = "")
).Result;
}

public string ExecPostRaw(string url = null, string payload = "", string contentType = "text/plain") => Post(
url ?? PostUrl,
new StringContent(payload, Encoding.UTF8, contentType)
).Result;
public string ExecPostRaw(string url = null, string payload = "", string contentType = "text/plain")
{
_client.DefaultRequestHeaders.ExpectContinue = payload.Length > ExpectContinueThreshold;
return Post(
url ?? PostUrl,
new StringContent(payload, Encoding.UTF8, contentType)
).Result;
}

public async Task<string> Get(string url)
{
Expand Down

0 comments on commit 2715277

Please sign in to comment.