Skip to content

Commit

Permalink
&& and > 0 in the conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
philipthomas-MSFT committed Jan 9, 2024
1 parent 0e158a8 commit 3d25862
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Microsoft.Azure.Cosmos/src/GatewayStoreClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ internal static async Task<DocumentClientException> CreateDocumentClientExceptio
}

// If service rejects the initial payload like header is to large it will return an HTML error instead of JSON.
if (string.Equals(responseMessage.Content?.Headers?.ContentType?.MediaType, "application/json", StringComparison.OrdinalIgnoreCase) ||
responseMessage.Content?.Headers.ContentLength != 0)
if (string.Equals(responseMessage.Content?.Headers?.ContentType?.MediaType, "application/json", StringComparison.OrdinalIgnoreCase) &&
responseMessage.Content?.Headers.ContentLength > 0)
{
try
{
Expand Down

0 comments on commit 3d25862

Please sign in to comment.