Skip to content

Commit 2715277

Browse files
committed
Set ExpectCompute based on the length of the payload
1 parent 4ac1d53 commit 2715277

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/BizHawk.Client.Common/Api/HttpCommunication.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,14 @@ public string ExecPost(string url = null, string payload = "")
4242
).Result;
4343
}
4444

45-
public string ExecPostRaw(string url = null, string payload = "", string contentType = "text/plain") => Post(
46-
url ?? PostUrl,
47-
new StringContent(payload, Encoding.UTF8, contentType)
48-
).Result;
45+
public string ExecPostRaw(string url = null, string payload = "", string contentType = "text/plain")
46+
{
47+
_client.DefaultRequestHeaders.ExpectContinue = payload.Length > ExpectContinueThreshold;
48+
return Post(
49+
url ?? PostUrl,
50+
new StringContent(payload, Encoding.UTF8, contentType)
51+
).Result;
52+
}
4953

5054
public async Task<string> Get(string url)
5155
{

0 commit comments

Comments
 (0)