Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
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
2 changes: 1 addition & 1 deletion dotnet/src/webdriver/DevTools/v135/V135Network.cs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ public override async Task ContinueRequestWithResponse(HttpRequestData requestDa
var commandSettings = new FulfillRequestCommandSettings()
{
RequestId = requestData.RequestId,
ResponseCode = responseData.StatusCode,
ResponseCode = responseData.StatusCode ?? throw new ArgumentException("Response data status code cannot be missing", nameof(responseData)),
};

if (responseData.Headers.Count > 0 || responseData.CookieHeaders.Count > 0)
Expand Down
2 changes: 1 addition & 1 deletion dotnet/src/webdriver/DevTools/v136/V136Network.cs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ public override async Task ContinueRequestWithResponse(HttpRequestData requestDa
var commandSettings = new FulfillRequestCommandSettings()
{
RequestId = requestData.RequestId,
ResponseCode = responseData.StatusCode,
ResponseCode = responseData.StatusCode ?? throw new ArgumentException("Response data status code cannot be missing", nameof(responseData)),
};

if (responseData.Headers.Count > 0 || responseData.CookieHeaders.Count > 0)
Expand Down
4 changes: 2 additions & 2 deletions dotnet/src/webdriver/DevTools/v137/V137Network.cs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ public override async Task ContinueRequestWithResponse(HttpRequestData requestDa
var commandSettings = new FulfillRequestCommandSettings()
{
RequestId = requestData.RequestId,
ResponseCode = responseData.StatusCode,
ResponseCode = responseData.StatusCode ?? throw new ArgumentException("Response data status code cannot be missing", nameof(responseData)),
};

if (responseData.Headers.Count > 0 || responseData.CookieHeaders.Count > 0)
Expand Down Expand Up @@ -354,7 +354,7 @@ private void OnFetchRequestPaused(object? sender, Fetch.RequestPausedEventArgs e
RequestId = e.RequestId,
Url = e.Request.Url,
ResourceType = e.ResourceType.ToString(),
StatusCode = e.ResponseStatusCode.GetValueOrDefault(),
StatusCode = e.ResponseStatusCode,
ErrorReason = e.ResponseErrorReason?.ToString()
};

Expand Down
2 changes: 1 addition & 1 deletion dotnet/src/webdriver/HttpResponseData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public HttpResponseData()
/// <summary>
/// Gets or sets the numeric status code of the HTTP response.
/// </summary>
public long StatusCode { get; set; }
public long? StatusCode { get; set; }

/// <summary>
/// Gets or sets the body of the HTTP response.
Expand Down
2 changes: 1 addition & 1 deletion dotnet/src/webdriver/NetworkResponseReceivedEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public NetworkResponseReceivedEventArgs(HttpResponseData responseData)
/// <summary>
/// Gets the HTTP status code of the network response.
/// </summary>
public long ResponseStatusCode { get; }
public long? ResponseStatusCode { get; }

/// <summary>
/// Gets the body of the network response.
Expand Down