You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: Body's reader is now optional; may be checked for emptiness
SUMMARY:
Fixes the integration issue with isahc, whereby a `isahc::Body` created from
`isahc::Body::reader`has a length of `None`, which signals to `isahc::Client`
to send a body with an unknown length. A length of `None` is interpreted as
being unknown, and therefore a body is sent with every request. This causes a
501 error on servers which do not permit a body in the request, such as GET
requests to Cloudflare CDNs.
CHANGES:
* Changed `http_client::Body`'s `reader` field to being optional
* Added a `http_client::Body::is_empty` method to check for emptiness
* On creating a new request for `isahc::Client`:
- Create a `isahc::Body::empty` if `http_client::Body` is empty
- Create a `isahc::Body::reader` if otherwise not empty
0 commit comments