http-rs / http-types

Common types for HTTP operations
https://docs.rs/http-types
Apache License 2.0
200 stars 84 forks source link

Rename Body::from_file, add Body::from_file #296

Closed brightly-salty closed 3 years ago

brightly-salty commented 3 years ago

This PR renames Body::from_file to Body::from_path, and adds Body::from_file, which takes an async_std::fs::File like the name would suggest.

Fixes #185.

Semver-major.

joshtriplett commented 3 years ago

This and https://github.com/http-rs/http-types/pull/318 have the same approach now, with slightly different handling of filename-based MIME-type guessing. See the comment at https://github.com/http-rs/http-types/pull/318#issuecomment-766195364 for a summary.

joshtriplett commented 3 years ago

Closing in favor of the similar implementation in https://github.com/http-rs/http-types/pull/318 , which additionally splits out path-based MIME-type guessing. But thank you very much for your work on this; much appreciated.