* Check for schema during URL parse error handling. Lots of unit tests.
* Introduce BadScheme; an error source. Change schema to scheme. Use BadScheme instead of the error text to determine that a scheme is not present.
There are functions to check if the error is from an array of different
reasons, but there were no functions to check if the failure was due to
the rest of the possible error reasons. This commit adds though.
Fixes#942
Changed the redirect types to be from the `redirect` module:
- `reqwest::RedirectPolicy` is now `reqwest::redirect::Policy`
- `reqwest::RedirectAttempt` is now `reqwest::redirect::Attempt`
- `reqwest::RedirectAction` is now `reqwest::redirect::Action`
Changed behavior of default policy to no longer check for redirect loops
(loops should still be caught eventually by the maximum limit).
Removed the `too_many_redirects` and `loop_detected` methods from
`Action`.
Added `error` to `Action` that can be passed any error type.
Closes#717
- The `Error`'s kind is a now a set of variants depending on the context
of when an error could occur.
- If another error was the cause, it is now always the `source`.
Along with the `is_*` methods, this should help in understanding *when*
a certain error occurred. For example, an error setting the TLS
certificates will return a builder error, with the TLS error as the
source. This should help differentiate from a TLS error that happens
when connecting to a server.
It also makes the internal code less dependent on all the exact
dependencies that can be enabled or disabled.
- System Conf is read as `ClientBuilder::build()` time, providing the
error earlier.
- If there is an error reading the resolve system conf, a better error
is reported.
- Resolver only needs to lock a mutex once to spawn the background task,
instead of every single `resolve` call.
The "Cargo feature" `default-tls`, which is enabled by default, is
added, with all TLS support relying on it. This allows using reqwest but
disabling the `native-tls` dependency, by disabling this feature.
Closes#225