Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dotnet] Tolerate invalid UTF-16 strings in DevTools JSON response #14972

Merged
merged 21 commits into from
Jan 10, 2025
Merged
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
d0f063a
[dotnet] Avoid exceptions in cdp logging on file upload
RenderMichael Dec 28, 2024
cce9b94
Revert "[java] JSpecify annotations for wrappers (#14396)"
RenderMichael Jan 8, 2025
5ca2f54
Accept invalid UTF16 strings in DevTools JSON responses
RenderMichael Jan 8, 2025
e0679f4
Merge branch 'trunk' into devtools-file-upload
RenderMichael Jan 8, 2025
43fc198
Reapply "[java] JSpecify annotations for wrappers (#14396)"
RenderMichael Jan 8, 2025
1010456
Revert "[dotnet] Avoid exceptions in cdp logging on file upload"
RenderMichael Jan 8, 2025
4bb41e9
[dotnet] Enable nullability on `DevToolsSessionDomains`
RenderMichael Jan 8, 2025
253e135
Merge branch 'trunk' into devtools-file-upload
RenderMichael Jan 8, 2025
187dcc4
Move DevTools JSON serialization options to base non-generated `DevTo…
RenderMichael Jan 8, 2025
cb16a00
Merge branch 'devtools-file-upload' of https://github.com/RenderMicha…
RenderMichael Jan 8, 2025
5a2bd35
remove accidental push
RenderMichael Jan 8, 2025
442b392
remove unnecessary diff
RenderMichael Jan 8, 2025
1588354
Use explicit type instead of `var`
RenderMichael Jan 8, 2025
6c09888
PR feedback
RenderMichael Jan 8, 2025
0f0ed1b
Apply suggestions from code review
RenderMichael Jan 8, 2025
4ae49b4
Move DevTools JSON options to a separate type
RenderMichael Jan 8, 2025
9fb4159
PR feedback
RenderMichael Jan 8, 2025
c3e257f
PR feedback
RenderMichael Jan 8, 2025
4d11714
Change `DevToolsJsonOptions` instance to `Default`
RenderMichael Jan 8, 2025
55f69d5
Improve comment in `StringConverter`
RenderMichael Jan 8, 2025
f13a6d9
Add file headers
RenderMichael Jan 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion dotnet/src/webdriver/DevTools/DevToolsSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,19 @@ private void ProcessMessage(string message)
var methodParts = method.Split(new char[] { '.' }, 2);
var eventData = messageObject["params"];

LogTrace("Recieved Event {0}: {1}", method, eventData.ToString());
nvborisenko marked this conversation as resolved.
Show resolved Hide resolved
if (eventData.AsObject().TryGetPropertyValue("request", out var requestNode)
&& requestNode.AsObject().ContainsKey("postData"))
{
var loggableEventData = eventData.DeepClone();
var loggableRequest = loggableEventData["request"]!;
loggableRequest["postData"] = "*RAW POST DATA REMOVED FROM LOGS*";
loggableRequest["postDataEntries"] = new JsonArray();
LogTrace("Recieved Event {0}: {1}", method, loggableEventData.ToString());
}
else
{
LogTrace("Recieved Event {0}: {1}", method, eventData.ToString());
}
RenderMichael marked this conversation as resolved.
Show resolved Hide resolved

// Dispatch the event on a new thread so that any event handlers
// responding to the event will not block this thread from processing
Expand Down