Skip to content

Do not expose HttpResponseMessage.Content == null to user code #386

Closed
@dougbu

Description

@dougbu

In recent (5.0 and newer) .NET runtimes, Content==null is impossible for user code to see. Even in older runtimes, HttpClient would never leave Content==null either.

Public code in this repo both exposes Content==null (inconsistently) and expects (mostly in tests) to see that state. Bad enough we expose that state but it being inconsistent (depending on the runtime version) makes things worse.

The action here is to change our code to both remove the inconsistencies i.e., have Content!=null everywhere regardless of the runtime version and update our expectations to handle Content!=null. This includes reverting tests removed on net6.0 in #384.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions