Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion dotnet/src/webdriver/Remote/HttpCommandExecutor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,8 @@ private Response CreateResponse(HttpResponseInfo responseInfo)

if (response.Value is string valueString)
{
response.Value = valueString.Replace("\r\n", "\n").Replace("\n", Environment.NewLine);
valueString = valueString.Replace("\r\n", "\n").Replace("\n", Environment.NewLine);
response = new Response(response.SessionId, valueString, response.Status);
}

return response;
Expand Down
25 changes: 22 additions & 3 deletions dotnet/src/webdriver/Response.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public class Response
/// <summary>
/// Initializes a new instance of the <see cref="Response"/> class
/// </summary>
[Obsolete("Set all values using the Response(string, object, WebDriverResult) constructor instead. This constructor will be removed in Selenium 4.30")]
public Response()
{
}
Expand All @@ -50,6 +51,7 @@ public Response()
/// Initializes a new instance of the <see cref="Response"/> class
/// </summary>
/// <param name="sessionId">Session ID in use</param>
[Obsolete("Set all values using the Response(string, object, WebDriverResult) constructor instead. This constructor will be removed in Selenium 4.30")]
public Response(SessionId? sessionId)
{
this.SessionId = sessionId?.ToString();
Expand Down Expand Up @@ -136,18 +138,35 @@ public static Response FromJson(string value)
/// <summary>
/// Gets or sets the value from JSON.
/// </summary>
public object? Value { get; set; }
public object? Value
{
get;

[Obsolete("The Response type will be immutable and this setter will be removed in Selenium 4.30")]
set;
}

/// <summary>
/// Gets or sets the session ID.
/// </summary>
public string? SessionId { get; set; }
public string? SessionId
{
get;

[Obsolete("The Response type will be immutable and this setter will be removed in Selenium 4.30")]
set;
}

/// <summary>
/// Gets or sets the status value of the response.
/// </summary>
public WebDriverResult Status { get; set; }
public WebDriverResult Status
{
get;

[Obsolete("The Response type will be immutable and this setter will be removed in Selenium 4.30")]
set;
}

/// <summary>
/// Returns a new <see cref="Response"/> from a JSON-encoded string.
Expand Down
Loading