-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Determine if Response body is populated #1216
Copy link
Copy link
Closed
Description
I was looking through the api provided for Response for a way to determine if body has been populated (or not) by some other part of the application. I can't immediately see a way to do this however.
I note that body is an Option per https://github.com/hyperium/hyper/blob/master/src/http/response.rs#L15 so simply being able to access Option::is_some would suit my use case.
Alternatively Response could be extended with a bool that could be used to indicate by application code that the current response is considered to be 'committed' and probably should not be further altered.
I'd be happy to provide a PR for either (or both) but I wanted to find out if this would be palatable before proceeding.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels