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

Ensure Content is read if ContentLength Header is null #27

Merged
merged 1 commit into from
Feb 13, 2024
Merged
Changes from all 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 Remora.Rest/Http/RestHttpClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ private async Task<Result<TEntity>> UnpackResponseAsync<TEntity>
}

// See if we have a JSON error to get some more details from
if (response.Content.Headers.ContentLength is not > 0)
if (response.Content.Headers.ContentLength == 0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Somewhat of a nitpick, but shouldn't this be is 0 for style/consistency

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Up to you, I was matching line 589 further up in the file that uses the same pattern. Whatever is decided on though I think those 2 checks should probably match.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, stick to the same as the other check - we can do a pass over constants + pattern matching later.

{
return new HttpResultError(response.StatusCode, response.ReasonPhrase);
}
Expand Down
Loading