File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
dotnet/src/webdriver/DevTools/Json Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,12 @@ internal sealed class StringConverter : JsonConverter<string>
1919 }
2020 catch ( InvalidOperationException )
2121 {
22- // CDP sometimes sends invalid surrogate pairs on file upload
22+ // Fallback to read the value as bytes instead of string.
23+ // System.Text.Json library throws exception when CDP remote end sends non-encoded string as binary data.
24+ // Using JavaScriptEncoder.UnsafeRelaxedJsonEscaping doesn't help because the string actually is byte[].
25+ // https://chromedevtools.github.io/devtools-protocol/tot/Network/#type-Request - here "postData" property
26+ // is a string, which we cannot deserialize properly. This property is marked as deprecated, and new "postDataEntries"
27+ // is suggested for using, where most likely it is base64 encoded.
2328
2429 var bytes = reader . ValueSpan ;
2530 var sb = new StringBuilder ( bytes . Length ) ;
You can’t perform that action at this time.
0 commit comments