All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Request::with_headers, to allow passing in many headers at a time. Thanks for the idea and PR, @rawhuul! (#110)
- The dev dependency tiny_http's version up to 0.12. Thanks for the PR, @davide125! (#107)
- Unnecessary buffering causing performance problems. Thanks for the PRs, @mrkline! (#102, #103)
- Connections failing if the first resolved address fails to connect (even if there's more to try). Thanks for the PR, @darosior! (#106)
- Removed upper bounds on the
serde_json
,log
andchrono
dependencies (dev-dependency in the case ofchrono
). If you were depending on minreq compiling with the MSRV compiler without any issues, check out the MSRV section in the readme, it's been updated with additional instructions. Thanks for the report, @RCasatta! (#99)
- Fragment handling, once again. Turns out you're not supposed to include fragments in the request. This may break usage with servers that are written with the wrong assumptions. Thanks for the report, @rawhuul! (#100)
Response::url
andResponseLazy::url
fields, to contain the final URL after redirects and fragment replacement semantics.
- Loosened the rustls version requirement from 0.21.6 to 0.21.1.
- From webpki to rustls-webpki. Thanks for the heads-up about webpki not being maintained, @RCasatta! (#98)
- Updated rustls and webpki-roots to their most recent versions.
- Maximum versions for the following dependencies to keep minreq compiling on
Rust 1.48:
- serde_json (
>=1.0.0, <1.0.101
) - log (
>=0.4.0, <0.4.19
) - chrono (dev-dependency,
>=0.4.0, <0.4.24
)
- serde_json (
- Errors when using an IP address as the host with HTTPS (tested with https://8.8.8.8). (#34)
- Proxy strings with the protocol included not working. Thanks for the report, @tkkcc! (#95)
- Default proxy from environment variables when the
proxy
feature is enabled, based on what curl does. Thanks for the PR, @krypt0nn! (#94)
- From lazy_static to once_cell for library internals. Thanks for the PR, @alpha-tango-kilo! (#80)
- A Read impl for ResponseLazy. Thanks for the PR, @Luro02! (#81)
- Building with
--all-features
, with thesend_https
function defaulting to the rustls-based implementation. Thanks for the PR, @tcharding! (#89) - An explicit minimum supported rust version policy. The MSRV for versions 2.x is 1.48. Thanks for the suggestion and PR, @tcharding! (#90)
- Performance improvements, test fixes, CI updates.
- The error returned when the request url does not start with
https://
orhttp://
now is now a slightly different IoError, with a clearer message. This will be changed to a proper minreq-specific error in 3.0, but for now it's an IoError to avoid breaking the Error type.
- The
urlencoding
feature for automatically percent-encoding urls. Thanks for the idea and PR, @alpha-tango-kilo! (#67, #68)
- GitHub API requests without User-Agent returning an IoError. Thanks for the report, @tech-ticks! (#66)
- Returning the wrong status code when the response was missing a status phrase. Thanks for the PR, @richarddd! (#64)
- Non-lazy requests crashing if the request had a very big Content-Length header. Thanks for the report, @Shnatsel! (#63)
- A regression in 2.4.1 where the port is no longer included in the
Host
, even if it's a non-standard port. Now the port is always included if it's in the request URL, and omitted if the port is implied. Thanks for the report, @ollpu! (#61)
- The port is no longer included in the
Host
header when sending requests, and port handling was cleaned up overall. This fixes issues with infinite redirections and https handshakes for some websites. Thanks to @Shnatsel for reporting the issues, and @joeried for debugging and figuring out the root cause of these problems! (#48, #49)
Request::with_param
for more ergonomic query parameter usage. Thanks for the PR, @sjvignesh! (#54)Request::with_max_headers_size
andRequest::with_max_status_line_length
for avoiding DoS when the server sends large headers or status lines. Thanks for the report, @Shnatsel! (#55)- Support for the
rustls-native-certs
crate via a newhttps-rustls-probe
feature. Thanks for the PR, @joeried! (#59)
- Chunk length handling for some servers with slightly off-spec chunk lengths. Thanks for the report, @Shnatsel! (#50)
- Timeouts not always being properly enforced. Thanks for the report, @Shnatsel! (#52)
- Removed some leftover printlns from the redirection update in 2.3.0 and ensured there's no printlns in the library anymore. Thanks for reporting the issue @Shnatsel! #45
- Fixed the timeout not being respected during the initial TCP connect. Thanks for the report and fix @KarthikNedunchezhiyan! #46, #47
- Breaking (sort of): the redirection code was improved to match
RFC 7231 section
7.1.2, which
could subtly break some programs relying on very specific redirects,
which is why this should be investigated if you come across weird
behaviour after updating. No API changes though, so only a minor
version bump. The following two points are now fixed when
redirecting:
- Fragments, the bit after a #-character in the url. If the
redirecting url has a fragment, and the one in
Location
does not, the original fragment should be included in the new url. IfLocation
does have a fragment, it should override the one in the redirecting url. - Relative urls. Minreq now properly redirects when
Location
is relative, e.g./Foo.html
instead ofhttps://example.com/Foo.html
. Thanks, @fjt523!
- Fragments, the bit after a #-character in the url. If the
redirecting url has a fragment, and the one in
- The
Content-Length: 0
header is now inserted into requests that should have it. Thanks, @KarthikNedunchezhiyan! - Status line parsing is now fixed, so "400 Bad Request" is not parsed as "400 Bad". Thanks, @KarthikNedunchezhiyan!
- M1 Mac support by bumping the ring dependency. Thanks, @ryanmcgrath!
- Some documentation which has been long due for an update. I just always forget when writing an actual update. No code changes!
- Support for
native-tls
andopenssl-sys
via new features, in addition torustls
. Thanks to @dubiousjim!
- Handling of status codes 204 and 304. Thanks to @Mubelotix!
- Proxy support via the
proxy
feature. Thanks to @rustysec!
- Fixed regression in header parsing caused by 2.0.2, which was yanked.
- Fixed a panic when sending a request to an invalid domain via https.
- Fixed a panic when parsing headers that have >1 byte unicode characters right after the ":" in the response.
- Made timeouts work as described in the documentation. Fixed issue #22.
- API for loading the HTTP response body through an iterator, allowing
for processing of the data during the download.
- See the
ResponseLazy
documentation for more information.
- See the
- Error type for all the errors that this crate can run into for
easier
?
usage and better debuggability. - Punycode support for non-ascii hostnames via the
punycode
feature. - Trailer header support.
- Examples
hello
,iterator
, andjson
.
- Breaking, will cause problems not detectable by the compiler:
Response headers' field names are now in lowercase, as they are
case-insensitive and this makes getting header values easier. The
values are unaffected. So if your code has
response.headers.get("Content-Type")
, you have to change it toresponse.headers.get("content-type")
, or it will not return what you want. - Breaking: Restructure the
Response
struct:- Removed
bytes
andbody_bytes
. - Added
as_bytes()
,into_bytes()
, andas_str()
in their place.
- Removed
- Breaking: Changed the
with_body
parameter type toInto<Vec<u8>>
fromInto<String>
.String
s implementInto<Vec<u8>>
, so this shouldn't cause any problems, unless you're using some interesting types that implementInto<String>
but notInto<Vec<u8>>
.
- Clean up the crate internals overall. Note: This might cause instability, if you're very concerned about stability, please hold off upgrading for a while.
- Remove
panic!
when trying to make anhttps://
request without thehttps
feature. The request will now return an error instead. The library should not panic anymore. - Audit the remaining
unwrap()
s from library code, none of them should actually ever cause a panic now.
create_request
in favor of just usingResponse::new
.
- Updated dependencies.
- Tests on Windows by changing the ip in tests from
0.0.0.0
tolocalhost
. - Reuse
rustls::ClientConfig
between requests. Content-Length
andTransfer-Encoding
detection failing because of case-sensitiveness.
json-using-serde
feature.
- The
body_bytes
field to Response, containing the body in raw bytes.
- Some clippy warnings.
- Panic when getting a non-UTF-8 response, instead setting the
body
string to an empty string, for now.
- HTTP response body handling.
- Support for the HTTP status codes 301, 302, 303, and 307.
- Less .clones()s.
- Fix response handling when
Transfer-Encoding
ischunked
.
- Moved to 2018 edition.
- HEAD requests and ones that receive a 1xx, 204, or 304 status code as a response.
- Timeout made optional.
- Updated dependencies.
- Improved performance for HTTP (not HTTPS) requests.