File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed
src/BizHawk.Client.Common Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,8 @@ public sealed class HttpCommunication
20
20
21
21
public int Timeout { get ; set ; }
22
22
23
+ public bool ExpectContinue { get ; set ; } = true ;
24
+
23
25
public HttpCommunication ( Func < byte [ ] > takeScreenshotCallback , string getURL , string postURL )
24
26
{
25
27
_takeScreenshotCallback = takeScreenshotCallback ;
@@ -49,6 +51,7 @@ public async Task<string> Get(string url)
49
51
public async Task < string > Post ( string url , FormUrlEncodedContent content )
50
52
{
51
53
_client . DefaultRequestHeaders . ConnectionClose = true ;
54
+ _client . DefaultRequestHeaders . ExpectContinue = ExpectContinue ;
52
55
HttpResponseMessage response ;
53
56
try
54
57
{
Original file line number Diff line number Diff line change @@ -231,6 +231,13 @@ public void HttpSetGetUrl(string url)
231
231
APIs . Comm . HTTP . GetUrl = url ;
232
232
}
233
233
234
+ [ LuaMethod ( "httpSetExpectContinue" , "Set ExpectContinue boolean to an explicit value" ) ]
235
+ public void HttpSetExpectContinue ( bool value )
236
+ {
237
+ CheckHttp ( ) ;
238
+ APIs . Comm . HTTP . ExpectContinue = value ;
239
+ }
240
+
234
241
[ LuaMethod ( "httpGetPostUrl" , "Gets HTTP POST URL" ) ]
235
242
public string HttpGetPostUrl ( )
236
243
{
@@ -245,6 +252,13 @@ public string HttpGetGetUrl()
245
252
return APIs . Comm . HTTP ? . GetUrl ;
246
253
}
247
254
255
+ [ LuaMethod ( "httpGetExpectContinue" , "Get ExpectContinue value" ) ]
256
+ public bool HttpGetExpectContinue ( )
257
+ {
258
+ CheckHttp ( ) ;
259
+ return APIs . Comm . HTTP . ExpectContinue ;
260
+ }
261
+
248
262
private void CheckHttp ( )
249
263
{
250
264
if ( APIs . Comm . HTTP == null )
You can’t perform that action at this time.
0 commit comments