- http1: fix
http1_header_read_timeout
to use same future (#2891) (c5a14e7c)
- ext: support non-canonical HTTP/1 reason phrases (#2792) (b2052a43)
- http1: fix preserving header case without enabling ffi (#2820) (6a35c175)
- server: don't add implicit content-length to HEAD responses (#2836) (67b73138)
- server:
- ffi (unstable):
hyper_clientconn_options_new
no longer sets thehttp1_preserve_header_case
connection option by default. Users should now callhyper_clientconn_options_set_preserve_header_case
if they desire that functionality. (78de8914)
- ffi: don't build C libraries by default (1c663706)
- client: avoid panics in uses of
Instant
(#2746) (dcdd6d10)
- client: implement the HTTP/2 extended CONNECT protocol from RFC 8441 (#2682) (5ec094ca)
- error: add
Error::message
(#2737) (6932896a, closes #2732) - http1: implement obsolete line folding (#2734) (1f0c177b)
- http1: return 414 when URI contains more than 65534 characters (#2706) (5f938fff, closes #2701)
- http2: received
Body::size_hint()
now return 0 if implicitly empty (#2715) (84b78b6c) - server: use case-insensitive comparison for Expect: 100-continue (#2709) (7435cc33, closes #2708)
- http2: add
http2_max_send_buf_size
option to client and server (bff977b7) - server: add HTTP/1 header read timeout option (#2675) (842c6553, closes #2457)
- client: cancel blocking DNS lookup if
GaiFuture
is dropped (174b553d
- http1: add
http1_writev(bool)
options to Client and Server builders, to allow forcing vectored writes (80627141) - upgrade: allow http upgrades with any body type (ab469eb3)
- client:
- h2: always include original h2 error on broken pipe (6169db25)
- server: Remove Send + Sync requirement for Body in with_graceful_shutdown (1d553e52)
- client: don't reuse a connection while still flushing (c88011da)
- server: convert panic to error if Connection::without_shutdown called on HTTP/2 conn (ea3e2282)
- ffi: add hyper_request_set_uri_parts (a54689b9)
- lib:
- ffi: on_informational callback had no headers (39b6d01a)
- http1: apply header title case for consecutive dashes (#2613) (684f2fa7)
- http2: improve errors emitted by HTTP2
Upgraded
stream shutdown (#2622) (be08648e)
- client: retry when pool checkout returns closed HTTP2 connection (#2585) (52214f39)
- http2:
- ffi: add hyper_request_on_informational (25d18c0b)
- http1:
- ffi: add option to get raw headers from response (8c89a8c1)
- http1: reduce memory used with flatten write strategy (eb0c6463)
- client: allow to config http2 max concurrent reset streams (#2535) (b9916c41)
- error: add
Error::is_parse_too_large
andError::is_parse_status
methods (#2538) (960a69a5) - http2:
- http2: reduce amount of adaptive window pings as BDP stabilizes (#2550) (4cd06bf2)
- http1: http1_title_case_headers should move Builder (a303b3c3)
- server: implement forgotten settings for case preserving (4fd6c4cb)
- client: add option to allow misplaced spaces in HTTP/1 responses (#2506) (11345394)
- http1: add options to preserve header casing (#2480) (dbea7716, closes #2313)
- client: omit default port from automatic Host headers (#2441) (0b11eee9)
- headers: Support multiple Content-Length values on same line (#2471) (48fdaf16, closes #2470)
- server: skip automatic Content-Length headers when not allowed (#2216) (8cbf9527, closes #2215)
- client: allow HTTP/0.9 responses behind a flag (#2473) (68d4e4a3, closes #2468)
- server: add
AddrIncoming::from_listener
constructor (#2439) (4c946af4)
- build: Fix compile error when only
http1
feature was enabled.
- client: HTTP/1 client "Transfer-Encoding" repair code would panic (#2410) (2c8121f1, closes #2409)
- http1: fix server misinterpretting multiple Transfer-Encoding headers (8f93123e)
- body:
- ffi:
- client: expose
connect
types without proto feature (#2377) (73a59e5f) - server: expose
Accept
without httpX features (#2382) (a6d4fcbe)
- Fixes building documentation.
- client:
- http1: Make HTTP/1 support an optional feature (2a19ab74)
- http2: Make HTTP/2 support an optional feature (b819b428)
- lib:
- server: Make the
server
code an optional feature (#2334) (bdb5e5d6) - upgrade: Moved HTTP upgrades off
Body
to a new API (#2337) (121c3313, closes #2086)
-
hyper depends on
tokio
v1 andbytes
v1. -
Custom resolvers used with
HttpConnector
must change to resolving to an iterator ofSocketAddr
s instead ofIpAddr
s. (b4e24332) -
hyper no longer emits
log
records automatically. If you need hyper to integrate with alog
logger (as opposed totracing
), you can addtracing = { version = "0.1", features = ["log"] }
to activate them. (db32e105) -
Removed
http1_writev
methods fromclient::Builder
,client::conn::Builder
,server::Builder
, andserver::conn::Builder
.Vectored writes are now enabled based on whether the
AsyncWrite
implementation in use supports them, rather than though adaptive detection. To explicitly disable vectored writes, users may wrap the IO in a newtype that implementsAsyncRead
andAsyncWrite
and returnsfalse
from itsAsyncWrite::is_write_vectored
method. (d6aadb83) -
The method
Body::on_upgrade()
is gone. It is essentially replaced withhyper::upgrade::on(msg)
. (121c3313) -
All optional features have been disabled by default. (ed2b22a7)
-
The HTTP server code is now an optional feature. To enable the server, add
features = ["server"]
to the dependency in yourCargo.toml
. (bdb5e5d6) -
The HTTP client of hyper is now an optional feature. To enable the client, add
features = ["client"]
to the dependency in yourCargo.toml
. (4e55583d) -
This puts all HTTP/1 methods and support behind an
http1
cargo feature, which will not be enabled by default. To use HTTP/1, addfeatures = ["http1"]
to the hyper dependency in yourCargo.toml
.
(2a19ab74)
- This puts all HTTP/2 methods and support behind an
http2
cargo feature, which will not be enabled by default. To use HTTP/2, addfeatures = ["http2"]
to the hyper dependency in yourCargo.toml
.
(b819b428)
- client: fix panic when addrs in ConnectingTcpRemote is empty (#2292) (01103da5, closes #2291)
- http2: reschedule keep alive interval timer once a pong is received (2a938d96, closes #2310)
- client:
- lib: Setting
http1_writev(true)
will now force writev queue usage (187c22af, closes #2282) - server: implement
AsRawFd
forAddrStream
(#2246) (b5d5e214, closes #2245)
- client: don't panic in DNS resolution when task cancelled (#2229) (0d0d3635)
- client: impl tower_service::Service for &Client (#2089) (77c3b5bc)
- http2: configure HTTP/2 frame size in the high-level builders too (#2214) (2354a7ee)
- lib: Move from
log
totracing
in a backwards-compatible way (#2204) (9832aef9)
- body: remove Sync bound for Body::wrap_stream (042c7706)
- http2: allow configuring the HTTP/2 frame size (b6446456)
- server: fix panic in Connection::graceful_shutdown (fce3ddce)
- http1: try to drain connection buffer if user drops Body (d838d54f)
- http2: add HTTP2 keep-alive support for client and server (9a8413d9)
- client: rename
client::Builder
pool options (#2142) (a82fd6c9) - http2: add adaptive window size support using BDP (#2138) (48102d61)
- server: add
poll_peek
toAddrStream
(#2127) (24d53d3f)
- body: return exactly 0 SizeHint for empty body (#2122) (dc882047)
- client: strip path from Uri before calling Connector (#2109) (ba2a144f)
- http1:
- http2: don't add client content-length if method doesn't require it (fb90d30c)
- service: Implement Clone/Copy on ServiceFn and MakeServiceFn (#2104) (a5720fab)
- http1: fix response with non-chunked transfer-encoding to be close-delimited (cb71d2cd, closes #2058)
- body: implement
HttpBody
forRequest
andResponse
(4b6099c7, closes #2067) - client: expose
hyper::client::connect::Connect
trait alias (2553ea1a)
- client:
- dependencies: require correct bytes minimum version (#1975) (536b1e18)
- server:
- body:
- client:
- impl tower_service::Service for Client (edbd10ac)
- provide tower::Service support for clients (#1915) (eee2a728)
- change connectors to return an
impl Connection
(4d7a2266) - remove
Destination
forhttp::Uri
in connectors (319e8aee) - filter remote IP addresses by family of given local IP address (131962c8)
- change
Resolve
to beService<Name>
(9d9233ce, closes #1903) - change
Connect
trait into an alias forService
(d67e49f1, closes #1902) - change
GaiResolver
to use a global blocking threadpool (049b5132) - Add connect timeout to HttpConnector (#1972) (4179297a)
- lib:
- rt: introduce
rt::Executor
trait (6ae5889f, closes #1944) - server:
- service:
- All usage of async traits (
Future
,Stream
,AsyncRead
,AsyncWrite
, etc) are updated to newer versions.
(8f4b05ae)
- All usage of
hyper::Chunk
should be replaced withbytes::Bytes
(orhyper::body::Bytes
).
(5a598757)
- Using a
Body
as aStream
, and constructing one viaBody::wrap_stream
, require enabling thestream
feature.
(511ea388)
- Calls to
GaiResolver::new
andHttpConnector::new
no longer should pass an integer argument for the number of threads.
(049b5132)
- Connectors no longer return a tuple of
(T, Connected)
, but a singleT: Connection
.
(4d7a2266)
- All usage of
hyper::client::connect::Destination
should be replaced withhttp::Uri
.
(319e8aee)
- All usage of
hyper::body::Payload
should be replaced withhyper::body::HttpBody
.
(c63728eb)
-
Any type passed to the
executor
builder methods must now implementhyper::rt::Executor
.hyper::rt::spawn
usage should be replaced withtokio::task::spawn
.hyper::rt::run
usage should be replaced with#[tokio::main]
or managing atokio::runtime::Runtime
manually.
(6ae5889f)
-
The
Resolve
trait is gone. All custom resolvers should implementtower::Service
instead.The error type of
HttpConnector
has been changed away fromstd::io::Error
.
(9d9233ce)
- Any manual implementations of
Connect
must instead implementtower::Service<Uri>
.
(d67e49f1)
- The server's behavior will now by default close
connections when receiving a read EOF. To allow for clients to close
the read half, call
http1_half_close(true)
when configuring a server.
(7e31fd88)
- Passing a
Stream
toServer::builder
orHttp::serve_incoming
must be changed to pass anAccept
instead. Thestream
optional feature can be enabled, and then a stream can be converted usinghyper::server::accept::from_stream
.
(b3e55062)
- Usage of
send_data
should either be changed to async/await or usetry_send_data
.
(62a96c07)
- body: identify aborted body write errors (32869224)
- client:
HttpConnector
: allow to set socket buffer sizes (386109c4)
- http1: force always-ready connections to yield after a few spins (8316f96d)
- http2: correctly propagate HTTP2 request cancellation (50198851)
- body: implement
http_body::Body
forhyper::Body
(2d9f3490) - client: Implement
TryFrom
forDestination
(#1810) (d1183a80, closes #1808) - server: add initial window builder methods that take self by-val (#1817) (8b45af7f)
- client:
- http2: fix import of h2::Reason to work on 1.26 (5680d944)
- http2: send a GOAWAY when the user's Service::poll_ready errors (42c5efc0)
- server: prohibit the length headers on successful CONNECT (d1501a0f, closes #1783)
- http2: check
Error::source()
for an HTTP2 error code to send in reset (fc18b680)
- client: coerce HTTP_2 requests to HTTP_11 (3a6080b1, closes #1770)
- http2: send INTERNAL_ERROR when user's Service errors (8f926a0d)
- error: implement
Error::source
when available (4cf22dfa, closes #1768) - http2: Add window size config options for Client and Server (7dcd4618, closes #1771)
- server: add
http2_max_concurrent_streams
builder option (cbae4294, closes #1772) - service:
- client: fix panic when CONNECT request doesn't have a port (d16b2c30)
- server:
- http2: revert http2 refactor causing a client hang (9aa7e990)
- client: parse IPv6 hosts correctly in HttpConnector (c328c62e)
- client:
- dependencies: disable unneeded optional tokio features (e5135dd6, closes #1739)
- http2: don't consider an h2 send request error as canceled (cf034e99)
- rt: prevent fallback reactor thread from being created accidentally (1d253b4d)
- server: add
server::conn::AddrIncoming::bind
constructor (2d5eabde)
- error: add
Error::is_connect
method (01f64983) - server:
- service: export
hyper::service::MakeServiceRef
(a522c315)
- http1: implement an adaptive read buffer strategy which helps with throughput and memory management (fd25129d, closes #1708)
- client: add
http1_read_buf_exact_size
Builder option (2e7250b6)
- client: add client::conn::Builder::executor method (95446cc3)
- server: change
NewService
toMakeService
with connection context (30870029, closes #1650)
- header: fix panic when parsing header names larger than 64kb (9245e940)
- client: add ALPN h2 support for client connectors (976a77a6)
- armv7: split record_header_indices loop to work around rustc/LLVM bug (30a4f237)
- http2: add Date header if not present for HTTP2 server responses (37ec724f)
- server: log and ignore connection errors on newly accepted sockets (66a857d8)
- client: allow calling
Destination::set_host
with IPv6 addresses (af5e4f3e, closes #1661) - server: use provided executor if fallback to HTTP2 (1370a6f8)
- http1: fix title-case option when header names have symbols (ca5e520e)
- http2: allow TE "trailers" request headers (24f11a42, closes #1642)
- server: properly handle keep-alive for HTTP/1.0 (1448e406, closes #1614)
- client: add
max_idle_per_host
configuration option (a3c44ded) - server: add
Server::with_graceful_shutdown
method (168c7d21, closes #1575)
- server: coerce responses with HTTP2 version to HTTP/1.1 when protocol is 1.x (195fbb2a)
- server:
- http1: reduce closed connections when body is dropped (6530a00a)
- client:
- server: add
Builder::http1_pipeline_flush
configuration (5b5e3090)
- client:
- client: enable CONNECT requests through the
Client
(2a3844ac) - http2: quickly cancel when receiving RST_STREAM (ffdb4788)
- body:
- client: add
set_scheme
,set_host
, andset_port
forDestination
(27db8b00, closes #1564) - error: add
Error::cause2
andError::into_cause
(bc5e22f5, closes #1542) - http1: Add higher-level HTTP upgrade support to Client and Server (#1563) (fea29b29, closes #1395)
- http2:
- server: add upgrading process to
poll_without_shutdown()
(#1530) (c6e90b7b)
- client: implement
Clone
forDestination
(15188b7c) - server:
- lib:
- body:
- client:
- rename
FutureResponse
toResponseFuture
(04c74ef5) - support local bind for
HttpConnector
(b6a3c85d, closes #1498) - add support for title case header names (#1497) (a02fec8c, closes #1492)
- add support to set
SO_NODELAY
on client HTTP sockets (016d79ed, closes #1473) - improve construction of
Client
s (fe1578ac) - redesign the
Connect
trait (8c52c2df, closes #1428)
- rename
- error: revamp
hyper::Error
type (5d3c4722, closes #1128, #1130, #1431, #1338) - rt: make tokio runtime optional (d127201e)
- server:
- service: introduce hyper-specific
Service
(2dc6202f, closes #1461)
- lib: remove deprecated tokio-proto APIs (a37e6b59)
- server: panic on max_buf_size too small (aac250f2)
-
Body::is_empty()
is gone. Replace withBody::is_end_stream()
, from thePayload
trait.(19f90242)
-
Each payload chunk must implement
Buf
, instead of justAsRef<[u8]>
.(a3be110a)
-
Replace any references of
hyper::client::FutureResponse
tohyper::client::ResponseFuture
.(04c74ef5)
-
The
Service
trait has changed: it has some changed associated types, andcall
is now bound to&mut self
.The
NewService
trait has changed: it has some changed associated types, andnew_service
now returns aFuture
.Client
no longer implementsService
for now.hyper::server::conn::Serve
now returnsConnecting
instead ofConnection
s, sincenew_service
can now return aFuture
. TheConnecting
is a future wrapping the new service future, returning aConnection
afterwards. In many cases,Future::flatten
can be used.(2dc6202f)
-
The
Server
is no longer created fromHttp::bind
, nor is itrun
. It is aFuture
that must be polled by anExecutor
.The
hyper::server::Http
type has move tohyper::server::conn::Http
.(c4974500)
-
Client:new(&handle)
andClient::configure()
are nowClient::new()
andClient::builder()
.(fe1578ac)
-
Error
is no longer an enum to pattern match over, or to construct. Code will need to be updated accordingly.For body streams or
Service
s, inference might be unable to determine what error type you mean to return.(5d3c4722)
-
All uses of
Handle
now need to be new-tokioHandle
.(27b8db3a)
-
Custom connectors should now implement
Connect
directly, instead ofService
.Calls to
connect
no longer takeUri
s, butDestination
. There arescheme
,host
, andport
methods to query relevant information.The returned future must be a tuple of the transport and
Connected
. If no relevant extra information is needed, simply returnConnected::new()
.(8c52c2df)
-
All code that was generic over the body as
Stream
must be adjusted to use aPayload
instead.hyper::Body
can still be used as aStream
.Passing a custom
impl Stream
will need to either implementPayload
, or as an easier option, switch toBody::wrap_stream
.Body::pair
has been replaced withBody::channel
, which returns ahyper::body::Sender
instead of afutures::sync::mpsc::Sender
.(fbc449e4)
-
Method
,Request
,Response
,StatusCode
,Version
, andUri
have been replaced with types from thehttp
crate.(3cd48b45)
- The variants of
Method
are now uppercase, for instance,Method::Get
is nowMethod::GET
. - The variants of
StatusCode
are now uppercase, for instance,StatusCode::Ok
is nowStatusCode::OK
. - The variants of
Version
are now uppercase, for instance,HttpVersion::Http11
is nowVersion::HTTP_11
.
- The variants of
-
The typed headers from
hyper::header
are gone for now.
The http::header
module is re-exported as hyper::header
.
For example, a before setting the content-length:
use hyper::header::ContentLength;
res.headers_mut().set(ContentLength(15));
And now after, with the http
types:
use hyper::header::{CONTENT_LENGTH, HeaderValue};
res.headers_mut().insert(CONTENT_LENGTH, HeaderValue::from_static("15"));
(3cd48b45)
-
The
mime
crate is no longer re-exported ashyper::mime
.The typed headers don't exist, and so they do not need the
mime
crate.To continue using
mime
for other purposes, add it directly to yourCargo.toml
as a dependency.(3cd48b45)
-
Removed
compat
cargo feature, andcompat
related API. This was the conversion methods for hyper's types to and fromhttp
crate's types.(3cd48b45)
-
Removed deprecated APIs: (a37e6b59)
- The
server-proto
cargo feature, which includedimpl ServerProto for Http
, and related associated types. client::Config::no_proto()
tokio_proto::streaming::Body::from(hyper::Body)
hyper::Body::from(tokio_proto::streaming::Body)
hyper::Body::from(futures::sync::mpsc::Receiver)
Http::no_proto()
- The
- client: prevent pool checkout looping on not-ready connections (ccec79da, closes #1519)
- server: skip SO_REUSEPORT errors (2c48101a, closes #1509)
- server: add Server::run_threads to run on multiple threads (8b644c1a)
- client: ensure idle connection is pooled before response body finishes (7fe9710a)
- header: remove charset=utf8 from
ContentType::text()
(ba789e65)
- server: prevent to output Transfer-encoding when server upgrade (#1465) (eb105679)
- client: introduce lower-level Connection API (1207c2b6, closes #1449)
- header: add
text()
andtext_utf8()
constructors toContentType
(45cf8c57) - server:
- client: return error if Request has
CONNECT
method (bfcdbd9f) - dependencies: require tokio-core 0.1.11 (49fcb066)
- client: add
Config::set_host
option (33a385c6)
- client:
- server:
- client:
- uri: make absolute-form uris always have a path (a9413d73)
- client: Client will retry requests on fresh connections (ee61ea9a)
- client: send an
Error::Cancel
if a queued request is dropped (88f01793)
- client: add
http1_writev
configuration option (b0aa6497)
- client: more reliably detect closed pooled connections (#1434) (265ad67c)
- h1: fix hung streaming bodies over HTTPS (73109694)
- client:
- server:
- server: add
Http::max_buf_size()
option (d22deb65, closes #1368) - uri: Add a
PartialEq<str>
impl forUri
(11b49c2c)
- h1: utilize
writev
when possible, reducing copies (68377ede)
- client: add
executor
method when configuring aClient
(c89019eb)
- client:
- lib: properly handle body streaming errors (7a48d0e8)
- client:
- conn: don't double shutdown in some cases (7d3abfbc)
- log: improve quality of debug level logs (7b593112)
- client:
- conn: handle when pre-emptive flushing closes the write state (8f938d97, closes #1391)
- lib: fix
no_proto
dispatcher to flush queue before polling more body (121b5eef) - server: allow TLS shutdown before dropping connections with
no_proto
(60d0eaf8, closes #1380)
- headers: Implement
ProxyAuthorization
(#1394) (c93cdb29) - server:
- client:
- header: implement
ByteRangeSpec::to_satisfiable_range
(bb54e36c) - lib: add support to disable tokio-proto internals (f7532b71)
- server:
- server: fix experimental pipeline flushing (6b4635fd)
- http: avoid infinite recursion when Body::from is called with Cow::Owned. (#1343) (e8d61737)
- header: add ContentType::xml() constructor (92595e84)
- http: add Body::from(cow) for bytes and strings (425ff71d)
- lib: implement compatibility with http crate (0c7d375b)
- server:
- server: try to read from socket at keep-alive (1a9f2648)
- client: don't assume bodies on 204 and 304 Responses (81c0d185, closes #1242)
- header: fix panic from headers.remove when typed doesn't match (4bd9746a)
- http:
- server:
- uri: fix Uri parsing of IPv6 and userinfo (7081c449, closes #1269)
- headers: export missing header types (c9f4ff33)
- server: Provide reference to Response body (a79fc98e, closes #1216)
- status: add
as_u16()
method toStatusCode
(5f6f252c)
- server: Handle 100-continue (6164e764)
- 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)
- 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)
- The
Cookie
header is no longer a wrapper over aVec<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 betweenHttpDate
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 implementsfmt::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 theClient
API has had it replaced withhyper::Uri
.This also means
Error::Uri
has changed types tohyper::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
anOption<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 the
hyper::header
module.
(40745c56)
-
Removes the undocumented
from_u16
function. UseStatusCode::try_from
instead.Also makes the
status
module private. All imports ofhyper::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 moremime!
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 useunicase::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)
- server: add local_addr to retrieve resolved address (71f250ad)
- server: don't dup the listener TCP socket. (d2362331)
- buffer: add from_parts and into_parts functions (78551dd0)
- http:
- header: implement fmt::Display for several headers (d5075770)
- header:
- header: add Headers::append_raw (6babbc40)
- header: security fix for header values that include newlines (2603d78f)
- net: set timeouts directly in
accept
(f5d4d653)
-
This technically will cause code that a calls
SetCookie.fmt_header
to panic, as it is no longer to properly write that method. Most people should not be doing this at all, and all other ways of printing headers should work just fine.The breaking change must occur in a patch version because of the security nature of the fix.
(2603d78f)
- client:
- header: remove
cookie
dependency (f22701f7) - lib:
-
There is no more
hyper::http::h2
.(d301c6a1)
-
The
Cookie
andSetCookie
headers no longer use the cookie crate. New headers can be written for any header, or the ones provided in hyper can be accessed as strings.(f22701f7)
-
There is no longer a
serde-serialization
feature. Look at external crates, likehyper-serde
, to fulfill this feature.(7b9817ed)
-
hyper will no longer provide OpenSSL support out of the box. The
hyper::net::Openssl
and related types are gone. TheClient
now uses anHttpConnector
by default, which will error trying to access HTTPS URLs.TLS support should be added in from other crates, such as hyper-openssl, or similar using different TLS implementations.
(2f48612c)
-
Usage of
with_proxy_config
will need to change to provide a network connector. For the same functionality, ahyper::net::HttpConnector
can be easily created and passed.(14a4f1c2)
- headers: add star, json, text, image constructors to Accept (a9fbbd7f)
- server: add 'take_buf' method to BufReader (bbbce5fc)
- client: close Pooled streams on sockopt error (d5ffee2e)
- error: re-export url::ParseError (30e78ac2)
- headers: Allow IPv6 Addresses in Host header (20f177ab)
- headers:
- server: accept combined certificate files (eeb1f48e)
- proxy: fix the 0.9.x build with
--no-default-features --features=security-framework
(6caffe9f, closes #819) - server: Request.ssl() works (ce0b62ea)
- client: Manually impl Debug for PooledStream (aa692236)
- server: Switch Ssl to SslServer in bounds (470bc8ec)
- net: Add OpensslClient constructor (3c0e1050)
- warnings: remove unused_code warnings from newest nightlies (e7229480)
- ssl:
- client:
- client: don't keep Pool mutex locked during getaddrinfo (5fcc04a6)
- Cargo.toml: update documentation link (b783ddf4)
- net: Add Ssl impls for security-framework (f37315b2)
- The re-exported Url type has breaking changes. (8fa7a989)
- header: add prefer and preference applied headers (6f649301, closes #747)
- net: Split Ssl into SslClient and SslServer (2c86e807, closes #756)
- headers: remove charset from
ContentType::json()
convenience method (ec568e9a) - net: fix the typo in
set_write_timeout
(7c76fff3)
- mime 0.2 depends on serde 0.7, so any instances of using older versions of serde will need to upgrade.
(146df53c)
- headers: allow ExtendedValue structs to be formatted and used as struct members (da0abe89)
- cargo: remove * dependencies for serde and env_logger (4a05bee9)
- server:
- headers: add extended parameter parser to the public API (402fb76b)
- all: add socket timeouts (fec6e3e8)
- headers:
- This adds 2 required methods to the
NetworkStream
trait,set_read_timeout
andset_write_timeout
. Any local implementations will need to add them.
(fec6e3e8)
- LanguageTags api is changed.
(c747f99d)
- response: respond with a 500 if a handler panics (63c6762c)
- headers: Add Access-Control-Expose-Headers (f783e991)
- server: Add hooks for HttpListener and HttpsListener to be started from existing listener (fa0848d4)
RequestBuilder<U>
should be replaced byRequestBuilder
.
(ff4a6070)
- client: add patch method to Client builder interface (03827c31)
- http:
- server: use EmptyWriter for status codes that have no body (9b2998bd)
- timeouts: remove rust #![feature] for socket timeouts (b8729698)
- headers: add PartialEq impl for Headers struct (76cbf384)
- client: EofReader by nature means the connection is closed (32e09a04)
- client: be resilient to invalid response bodies (75c71170, closes #640)
- examples: "cargo test --features serde-serialization" (63608c49)
- http: fix several cases in HttpReader (5c7195ab)
- server: Add Handler per-connection hooks (6b6182e8)
- client: fix panics when some errors occurred inside HttpMessage (ef15257b)
- headers: case insensitive values for Connection header (341f8eae, closes #635)
-
This changes the signature of HttpWriter.end(), returning a
EndError
that is similar to std::io::IntoInnerError, allowing HttpMessage to retrieve the broken connections and not panic.The breaking change isn't exposed in any usage of the
Client
API, but for anyone usingHttpWriter
directly, since this was technically a public method, that change is breaking.
(ef15257b)
- client: close connection when there is an Error (d32d35bb)
- client:
- nightly: remove feature flag for duration (0455663a)
- headers: Content-Range header (af062ac9)
- net: impl downcast methods for NetworkStream (without + Send) (1a91835a, closes #521)
- server: add Request.ssl() to get underlying ssl stream (7909829f, closes #627)
- raw-fd: implement FromRawFd/FromRawSocket (664bde58)
- headers: fix broken deserialization of headers (f5f5e1cb)
- net:
- Any custom implementation of NetworkStream must now
implement
set_read_timeout
andset_write_timeout
, so those will break. Most users who only use the provided streams should work with no changes needed.
Closes #315
(7d1f154c)
- tests: iter.connect() is now iter.join() (d2e8b5dc)
- http: add optional serialization of common types via
serde
(87de1b77)
- client: add url property Response (82ed9092)
- headers: add strict-transport-security header (7c2e5124, closes #589)
- Access-Control-Allow-Origin does no longer use Url
(ed458628)
- Technically a break, since
Response::new()
takes an additional argument. In practice, the only place that should have been creating Responses directly is inside the Client, so it shouldn't break anyone. If you were creating Responses manually, you'll need to pass a Url argument.
(82ed9092)
- benches: adjust to missing
set_ssl_verifier
(eb38a11b) - cargo: fix linking on OSX 10.10 (9af2b66f)
- client: use Ssl instance in creation of SslStream (1a490e25)
- client: check for drained stream in Response::drop (e689f203)
- client:
- error: add private
__Nonexhaustive
variant to Error (7c0421e3) - headers:
- http2:
- langtags: use true language tags in headers (99ff7e62)
- ssl: redesign SSL usage (53bba6eb)
- AcceptLanguage and ContentLanguage use LanguageTag now, Language removed from Hyper.
(99ff7e62)
- Server::https was changed to allow any implementation of Ssl. Server in general was also changed. HttpConnector no longer uses SSL; using HttpsConnector instead.
(53bba6eb)
- Connectors and Protocols passed to the
Client
must now also have aSync
bounds, but this shouldn't break default usage.
(64e47b4b)
- parse_header returns Result instead of Option, related code did also change
(195a89fa)
- Adds a new variant to public Error enum. The proper fix
is to stop matching exhaustively on
hyper::Error
.
(7c0421e3)
- A new variant
Http2
added to a public enumhyper::Error
.
(48e9ca2f)
hyper::client::request::Response
is no longer generic overNetworkStream
types. It no longer requires a generic type parameter at all.
(aa297f45)
- buffer: check capacity before resizing (b1686d1b)
- client: implement Default trait for client (be041d91)
- header: add ContentType::form_url_encoded() constructor (2c99d4e9)
- headers: return hyper::Error instead of () from header components (5d669399)
- http: add get_mut method to HttpReader (e64ce8c0)
- Error enum extended. Return type of header/shared/ types changed.
(5d669399)
- client:
- mock: adjust ChannelMockConnector connect method to compile (085d7b07)
- header:
- net:
- server: check Response headers for Connection: close in keep_alive loop (49b5b8fd)
- Usage of Response.deconstruct() and construct() now use a &mut Headers, instead of the struct proper.
(49b5b8fd)
- If you use deref! from the header module, you'll need to switch to using __hyper__deref!.
(62d96adc)
-
Any custom Connectors will need to change to &self in the connect method. Any Connectors that needed the mutability need to figure out a synchronization strategy.
Request::with_connector() takes a &NetworkConnector instead of &mut. Any uses of with_connector will need to change to passing &C.
(1b318724)
- Adding a new required method to a public trait is a breaking change.
(a5d632b6)
- error: add Ssl variant to hyper::Error (972b3a38, closes #483)
- headers:
- method: implement
AsRef<str>
forMethod
(c29af729) - server:
- Adds a variant to
hyper::Error
, which may break any exhaustive matches.
(972b3a38)
- The terms
Http
andError
have been removed from the Error type and its variants.HttpError
should now be accessed ashyper::Error
, and variants likeHttpIoError
should be accessed asError::Io
.
(9ba074d1)
- Add variant to Access-Control-Allow-Origin enum
(5e341714)
- Upgrade header Protocol changed.
(f47d11b9)
from_one_raw_str()
returnsNone
on empty values.
(a6974c99)
- client: add a Connection Pool (1e72a8ab, closes #363, #41)
- headers: Add If-Range header (a39735f1, closes #388)
- headers:
- client:
- headers: Implement Content-Language header field (308880b4, closes #475)
- net: add https_using_context for user-supplied SslContext (1a076d1b)
- server: allow consumer to supply an SslContext (3a1a2427, closes #471)
- This removes the trait
IntoBody
, and instead usingInto<Body>
, as it's more idiomatic. This will only have broken code that had custom implementations ofIntoBody
, and can be fixed by changing them toInto<Body>
.
(a2aefd9a)
- http: Adjust httparse Request and Response lifetimes. (76550fdb)
- server: JoinHandle type parameter (c694b138)
- debug: add Debug impls for StatusClass, Server, and Listening (0fb92ee7)
- server:
- http: Implement Debug for HttpReader/Writer. (2f606c88)
- log: clean up logging (4f09b002)
- net: make HttpStream implement Debug (7b7f9c25)
- headers: Content-Encoding needs a hyphen. (ca2815ef)
AccessControlAllowHeaders
andAccessControlRequestHeaders
values are case insensitive now.AccessControlAllowOrigin
variants are nowAny
andValue
to match the other headers.
(94f38950)
If-Match
,If-None-Match
andVary
item variant name changed toItems
(38d297b1)
Etag
header field is nowETag
header field
(4434ea6a)
-
For people using the default HttpConnector and Client, everything should continue to just work. If the Client has been used with a generic parameter, it should be removed.
However, there were some breaking changes to the internals of NetworkConnectors. Specifically, they no longer return a NetworkStream, but instead a Into<Box<NetworkStream + Send>>. All implementations of NetworkStream should continue to just work, however.
Possible breakages could come from the stricter usage of Send throughout the Client API.
(139a51f1)
- README: Update to compile example against Rust beta (341f19d3)
- headers: Add CowStr as a temporary hack to build on beta. (8e065563)
- rustup: update to rust beta (0f5858f3)
- Removed impl_header!() and impl_list_header!() macros, use new header!() macro.
(262c450f)
- buffer: zero out new capacity when buffer grows (cfdabd70)
- entitytag: Add EntityTag comparison, make EntityTag safe to use (9c21f7f9)
- buffer: get_buf to not return consumed part of buffer (04e3b565, closes #406)
- rustup: get rid of slice pattern, add
Reflect
bounds (c9f2c841)
- rustup: static bounds required on Type definition, trivial_casts (eee7a85d)
- rustup:
- benches: removed unused features (104d4903)
- rustup:
- server: use SocketAddrs instead of Ipv4Addrs (5d7be77e)
- header: Fix charset parsing bug. (5a6e176f)
- headers: Fix overflow with empty cookies (99baaa10)
- rustup: update to latest rustc (4fd8a6a9)
- Several public functions and types in the
http
module have been removed. They have been replaced with 2 methods that handle all of the http1 parsing.
(b87bb20f)
- added requirement that all HeaderFormat implementations must also be fmt::Debug. This likely as easy as slapping #[derive(Debug)] on to any custom headers.
(df756871)
- Check the docs. Everything was touched.
(0fd6fcd7)
- rustup: str.split and associated type changes (1b6e6a04)
- headers: use $crate when referring to hyper modules on macros (e246c3ac, closes #323)
- rustup:
- Send changes (4f5b97fe)
- CowString is gone (98b8c4b1)
- Extend now takes an IntoIterator (598d8f93)
- Add PhantomData markers to phantom type users (1904c456)
- Remove uses of the obsolete &a[] syntax (039e984f)
- Fix signature of IntoCow (234fcdc3)
- update feature flags (b47f9365)
- use module-level thread functions (fc2076cd)
- update lifetime bounds (f4a66b38)
- server: make AcceptorPool::accept() block and allow non'-static data (b0a72d80)
- header: Support arbitrary status codes (73978531)
- headers:
- server: Rewrite the accept loop into a custom thread pool. (3528fb9b)
- This removes unregistered status codes from the enum. Use
FromPrimitive
methods to create them now. StatusCode and StatusClass can no longer be casted tou16
, useToPrimitive
methods now. For examplestatus.to_u16().unwrap()
to get the status code number.
(73978531)
- net: don't stop the server when an SSL handshake fails with EOF (55f12660)
- readme: Make the README client example work (9b5d6aab)
- headers: add IfUnmodifiedSince header (b5543b67)
- for any consumers of the Etag header, since the entity tag is now in a tuple.
(28fd5c81)
- headers: Don't display q if q=1 in quality item. (91df2441, closes #281)
- rustup: update io import, Writer::write (f606b603)
- status: add is_<status_class>() methods to StatusCodes (2d55a22e)
- headers:
- log: update to new logging levels (b002b6c3)
- Change header
Cookie
toCookie
(92f43cf8)
- rustup: update to newest fmt trait names and slice syntax (9e3c94d7)
- Implementations of Header will need to adjust the header_name method. It no longer takes any arguments.
(8215889e)
- headers: make Schemes, Basic, Protocol public (e43c35c1)
- imports: Update TypeID import location to "any" (dd2534a6)
- server: add a deconstruct method to Request. (1014855f)
- server: Increase MAX_HEADER_FIELD_LENGTH to 4k (54238b28)
- net: