Releases: seanmonstar/warp
Releases · seanmonstar/warp
v0.1.6
- Features:
- Add Conditional and Range request support for
warp::fsfilters. - Relaxed bounds on
Rejection::withto no longer need to beSized. - Add
warp::path::peek()which gets the unmatched tail without adjusting the currently matched path.
- Add Conditional and Range request support for
v0.1.5
-
Features:
- Serve
index.htmlautomatically withwarp::fs::dirfilter. - Include
last-modifiedheader withwarp::fsfilters. - Add
warp::redirectto easily reply with redirections. - Add
warp::reply::{with_status, with_header}to wrapimpl Replys directly with a new status code or header. - Add support for running a warp
Serverwith a custom source of incoming connections.Server::run_incomingto have the runtime started automatically.Server::serve_incomingto get a future to run on existing runtime.- These can be used to support Unix Domain Sockets, TLS, and other transports.
- Add
Rejection::into_cause()to retrieve the original error of a rejection back. - Add
Rejection::json()to convert a rejection into a JSON response.
- Serve
-
Fixes
- Internal errors in warp that result in rendering a
500 Internal Server Errorare now also logged at theerrorlevel.
- Internal errors in warp that result in rendering a
v0.1.4
- Features:
- Add
warp::reply::with::headers(HeaderMap)filter wrapper. - Add
warp::cookie::optional()to get an optional cookie value. - Add
warp::path::full()to be able to extract the full request path without affecting route matching. - Add graceful shutdown support to the
Server. - Allow empty query strings to be treated as for
warp::query().
- Add
v0.1.3
- Features:
- Add
warp::reject::forbidden()to represent403 Forbiddenresponses. - Add
Rejection::with(cause)to customize rejection messages.
- Add
- Fixes:
- Fix
warp::body::formto allow charsets in thecontent-typeheader.
- Fix
v0.1.2
- Features:
- Implemented
ReplyforResponse<impl Into<hyper::Body>, allowing streaming response bodies. - Add
warp::body::stream()filter to access the request body as animpl Stream. - Add
warp::ws2()as a more flexible websocket filter.- This allows passing other extracted values to the upgrade callback, such as a value from a header or path.
- Deprecates
warp::ws(), andws2()will becomews()in 0.2.
- Add
warp::get2(),warp::post2(),warp::put2(), andwarp::delete2()as more standard method filters that are used via chaining instead of nesting.get(),post(),put(), anddelete()are deprecated, and the new versions will become them in 0.2.
- Add
Filter::unify()for when a filter returnsEither<T, T>, converting theEitherinto the innerT, regardless of which variant it was.-
This requires that both sides of the
Eitherbe the same type. -
This can be useful when extracting a value that might be present in different places of the request.
// Allow `MyId` to be a path parameter or a header... let id = warp::path::param::<MyId>() .or(warp::header::<MyId>()) .unify(); // A way of providing default values... let dnt = warp::header::<bool>("dnt") .or(warp::any().map(|| true)) .unify();
-
- Add
content-typeheader automatically to replies fromfileanddirfilters based on file extension. - Add
warp::head(),warp::options(), andwarp::patch()as new Method filters. - Try to use OS blocksize in
warp::fsfilters.
- Implemented
- Fixes:
- Chaining filters that try to consume the request body will log that the body is already consumed, and return a
500 Internal Server Errorrejection.
- Chaining filters that try to consume the request body will log that the body is already consumed, and return a
v0.1.1
- Features:
- add
warp::query::raw()filter to get query as aString. - add
Filter::recover()to ease customizing of rejected responses. - add
warp::header::headers_clone()filter to get a clone of request'sHeaderMap. - add
warp::path::tail()filter to get remaining "tail" of the request path.
- add
- Fixes:
- URL decode path segments in
warp::fsfilters.
- URL decode path segments in