This allows servers to check if an incoming URI is in absolute form.
Especially useful for proxies to determine if the request was meant to
be proxied or aimed directly at the proxy server.
* Move to the Trusty distro, since Precise is nearing end of life this year
(https://blog.travis-ci.com/2017-04-17-precise-EOL)
* Add a --verify flag to avoid kcov segfaults.
This was the reason why a 0% coverage was reported
* Link dead code to get more pessimistic results
The `Cookie` header now has 'set' and `get` methods, to treat the list of
cookies as a map.
Closes#1145
BREAKING CHANGE: The `Cookie` header is no longer a wrapper over a
`Vec<String>`. It must be accessed via its `get` and `append` methods.
This makes the `u16` in `Quality` private, since it only has a valid
range of 0-1000, and can't be enforced in public. The `q` function now
allows both `f32`s and `u16`s to construct a `Quality`.
BREAKING CHANGE: Any use of `Quality(num)` should change to `q(num)`.
This removes the need for someone to use the `time` crate to create a
date compatible with HTTP headers. It now works with the `SystemTime`
type from the standard library.
BREAKING CHANGE: `HttpDate` no longer has public fields. Convert between
`HttpDate` and `SystemTime` as needed.
They can be re-added later, removing now prevents that fix from being a
breaking change.
BREAKING CHANGE: The `link_extensions` methods of the `Link` header are
removed until fixed.
This will make the `HttpConnector` require the `scheme` to be `http`,
and return an error otherwise. This value is enabled by default, so any
requests to URLs that aren't of scheme `http` will now see an error
message stating the failure.
When constructing a connector that wraps an `HttpConnector`, this
enforcement can be disabled to allow connecting over TCP easily even
when the scheme is not `http`. To do, call
`connector.enforce_http(false)`.
The `header::Formatter` ensures that a formatted header is written to a
line, and allows for headers that require multiple lines. The only
header to specifically require this is `Set-Cookie`.
BREAKING CHANGE: The `fmt_header` method has changed to take a different
formatter. In most cases, if your header also implements
`fmt::Display`, you can just call `f.fmt_line(self)`.
The `TE` header is used by a client to specify which
transfer encodings other than `chunked` it will accept.
It also specifies whether HTTP trailers are acceptable.
This commit also adds a `Trailers` variant to the
`hyper::header::shared::Encoding` enum.
Closes#1109
BREAKING CHANGE: The `Encoding` enum has an additional
variant, `Trailers`.
Allow users to access the body of the request.
Useful when one wants to modify the request based
on the data in the body, e.g. to add checksum headers.
Change the internal representation of Origin to be more allocator
friendly. The internals of the Origin header are now private to allow
changing them in the future.
BREAKING CHANGES:
- Old code that accesses the Origin struct directly will stop working.
Change the internal implementation of some simple headers to make them
more allocator friendly. Also add a constructor method to allow changing
the implementation in the future again.
The headers are:
- Location
- Referrer
- Server
- UserAgent
This change was suggested in [#1104].
BREAKING CHANGES:
- Old code that creates the header structs directly will stop working.
- It's not possible to implement DerefMut for a Cow<'static,str>. Code
that needs to modify header after creation will stop working.