v0.11.0
Bug Fixes
- header:
- add length checks to
ETag
parsing (643fac1e) - prevent 2 panics in
QualityItem
parsing (d80aae55) - Allow IPv6 Addresses in
Host
header (8541ac72) - Remove raw part when getting mutable reference to typed header (f38717e4, closes #821)
- only add chunked to
TransferEncoding
if not present (1b4f8579) - ignore invalid cookies (310d98d5)
- add length checks to
- http:
- server:
- support HTTP/1.1 pipelining (523b890a)
Features
- body:
- client:
- add
HttpConnector.enforce_http
(1c34a05a) - add an accessor for the request body (4e26646a)
- Response.status() now returns a
StatusCode
by value (d63b7de4) - add Client::handle (9101817b)
- add Request.set_proxy for HTTP proxy requests (e8714116, closes #1056)
- DNS worker count is configurable (138e1643)
- add keep_alive_timeout to Client (976218ba)
- add
- error: Display for Error shows better info (49e196db, closes #694)
- header:
- add ContentType::octet_stream() constructor (1a353102)
- change
Cookie
to be map-like (dd03e723, closes #1145) - add
Cookie::iter()
(edc1c0dd) - implement fmt::Display for several headers (e9e7381e)
- add
Headers::append_raw
(b4b2fb78) - Add support for Retry-After header (1037bc77)
- add
Encoding::Brotli
variant (f0ab2b6a) - introduce
header::Raw
(#869) (50ccdaa7) - add
TE
header struct (#1150) (f1859dfd, closes #1109) - support Opaque origin headers (#1147) (41485997, closes #1065)
- add
HeaderView.raw()
(8143c33b) impl Eq for ContentType
(bba761ac)- add
Link
header implementation (592c1e21, closes #650) - add
star
,json
,text
,image
constructors toAccept
(bdc19d52) - Add strict-origin and strict-origin-when-cross-origin referer policy (3593d798)
- support multiple values for Referrer-Policy header (7b558ae8, closes #882)
- add
Warning
header (69894d19, closes #883) Headers::remove
returns the Header (9375addb, closes #891)- add
ContentLocation
header (13c5bf66, closes #870) - add
LastEventId
header (e1542a60) - add `Origin header (01843f88, closes #651)
- Add
ReferrerPolicy
header (3a86b3a2)
- http:
- lib:
- mime: upgrade to mime v0.3 (f273224f, closes #738)
- server:
- status:
- uri:
- version: impl
FromStr
forHttpVersion
(47f3aa62)
Breaking Changes
- The
Cookie
header is no longer a wrapper over a
Vec<String>
. It must be accessed via itsget
andset
methods.
(dd03e723)
- Any use of
Quality(num)
should change toq(num)
.
(a4644959)
HttpDate
no longer has public fields. Convert between
HttpDate
andSystemTime
as needed.
(316c6fad)
- The
link_extensions
methods of theLink
header are
removed until fixed.
(011f28cb)
- The
fmt_header
method has changed to take a different
formatter. In most cases, if your header also implements
fmt::Display
, you can just callf.fmt_line(self)
.
(6f02d43a)
- The
Encoding
enum has an additional variant,Trailers
.
(f1859dfd)
Origin.scheme
andOrigin.host
now returnOption
s, since theOrigin
could benull
.
(41485997)
- If you were explicitly checking the
StatusCode
, such as
with an equality comparison, you will need to use the value instead of a
reference.
(d63b7de4)
- This removes several deprecated methods for converting
Headers into strings. Use more specialized methods instead.
(ec91bf41)
-
The
Url
type is no longer used. Any instance in the
Client
API has had it replaced withhyper::Uri
.This also means
Error::Uri
has changed types to
hyper::error::UriError
.The type
hyper::header::parsing::HTTP_VALUE
has been made private,
as an implementation detail. The functionhttp_percent_encoding
should be used instead.
(4fb7e6eb)
- This makes
Request.remote_addr
an
Option<SocketAddr>
, instead ofSocketAddr
.
(e04bcc12)
- The
Preference
header had a typo in a variant and it's string representation,
changePreference::HandlingLeniant
toPreference::HandlingLenient
.
(2fa414fb) Server
is no longer the primary entry point. Instead,
anHttp
type is created and then eitherbind
to receive aServer
,
or it can be passed to other Tokio things.
(f45e9c8e)- The name of
RequestUri
has changed toUri
. It is no
longer anenum
, but an opaque struct with getter methods.
(9036443e)
- This adds a new variant to the
Encoding
enum, which
can break exhaustive matches.
(f0ab2b6a)
- The fields of the
Host
header are no longer
available. Use the getter methods instead.
(cd9fd522)
- A big sweeping set of breaking changes.
(2d2d5574)
Headers.remove()
used to return abool
,
it now returnsOption<H>
. To determine if a a header exists,
switch toHeaders.has()
.
(9375addb)Header::parse_header
now receives&Raw
, instead of
a&[Vec<u8>]
.Raw
provides several methods to ease using it, but
may require some changes to existing code.
(50ccdaa7)- LanguageTag used to be at the crate root, but it is now
in thehyper::header
module.
(40745c56)
-
Removes the undocumented
from_u16
function. Use
StatusCode::try_from
instead.Also makes the
status
module private. All imports of
hyper::status::StatusCode
should behyper::StatusCode
.
(f953cafe)
- All usage of
status.class()
should change to
equivalentstatus.is_*()
methods.
(94ee6204)
-
Most uses of
mime
will likely break. There is no more
mime!
macro, nor aMime
constructor, norTopLevel
andSubLevel
enums.Instead, in most cases, a constant exists that can now be used.
For less common mime types, they can be created by parsing a string.
(f273224f)
- To use
RawStatus
, you must enable theraw_status
crate feature.
(acd62cda)
- Some headers used
UniCase
, but now use
unicase::Ascii
. Upgrade code toAscii::new(s)
.
(c81edd41)
- This breaks a lot of the Client and Server APIs.
Check the documentation for how Handlers can be used for asynchronous
events.
(d35992d0)
Thanks
Ahmed Charles
Aidan Hobson Sayers
Alexander Mielczarek
Alex Crichton
Alexey Zabelin
Andre Silva
Andy Moran
Anthony Ramine
Aravind Gollakota
Corey Farwell
Daiki Mizukami
Darin Minamoto
David Ross
derekdreery
Dmitry Gritsay
Ed Barnard
Eric Chiang
Florent Monjalet
Garrett Squire
Georg Brandl
golem131
Guillaume Gomez
hag
Jake Goulding
James Kay
James Munns
Joe Wilm
Jonathan Giddy
Joonas Koivunen
Josh
Julian Tescher
Julius de Bruijn
Justin Mayhew
Kei Tsuji
Kornelijus Survila
Laurent Arnoud
leonardo.yvens
liamchristopher
M3rs
Markus Unterwaditzer
Matthew Dawson
mayah
Michael
Michael Killough
Michael Zapata
Mikhail Pak
Nick Gonzales
Pyfisch
Raghav
Ran Benita
Richard Dodd
Robin Stocker
Sander Maijers
Sean McArthur
Shane Gibbs
Simon Smith
sinkuu
softprops
taku0
Tasos Bakogiannis
Tom Burdick
Tshepang Lekhonkhobe
Utkarsh Kukreti
Vincent Prouillet
wangcong
Yazad Daruvala
YetAnotherMinion
Yves Dorfsman