File tree 1 file changed +5
-0
lines changed
dotnet/src/webdriver/Remote
1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ public class HttpCommandExecutor : ICommandExecutor
39
39
private const string PngMimeType = "image/png" ;
40
40
private const string Utf8CharsetType = "utf-8" ;
41
41
private const string RequestAcceptHeader = JsonMimeType + ", " + PngMimeType ;
42
+ private const string RequestContentTypeHeader = JsonMimeType + "; charset=" + Utf8CharsetType ;
42
43
private const string UserAgentHeaderTemplate = "selenium/{0} (.net {1})" ;
43
44
private Uri remoteServerUri ;
44
45
private TimeSpan serverResponseTimeout ;
@@ -257,6 +258,10 @@ private async Task<HttpResponseInfo> MakeHttpRequest(HttpRequestInfo requestInfo
257
258
258
259
byte [ ] bytes = Encoding . UTF8 . GetBytes ( eventArgs . RequestBody ) ;
259
260
requestMessage . Content = new ByteArrayContent ( bytes , 0 , bytes . Length ) ;
261
+
262
+ MediaTypeHeaderValue contentTypeHeader = new MediaTypeHeaderValue ( JsonMimeType ) ;
263
+ contentTypeHeader . CharSet = Utf8CharsetType ;
264
+ requestMessage . Content . Headers . ContentType = contentTypeHeader ;
260
265
}
261
266
262
267
HttpResponseMessage responseMessage = await this . client . SendAsync ( requestMessage ) ;
You can’t perform that action at this time.
0 commit comments