- Replace
flate2
withdeflate
- Fixed handling of url-encoded path components in route!() macro. Previously, URL was eagerly decoded and thus would fail to match intended routes if special characters were used (such as ? or /). Now, individual matched components are decoded after matching.
- Added
Response::empty_204
. - Added ssl feature and new_ssl constructor to Server, for https support. The certificate and private key must be supplied by user.
- Dropped the use of rustc-serialize in favor of using serde.
- Updated
multipart
to 0.13. Theinput::multipart::get_multipart_input
function returns types reexported frommultipart
which have small but breaking API changes. - Update
Server
with an option to use a thread pool to process requests
input::cookies
changed to return an iterator that yields(&str, &str)
.
- The
content_encoding
module now supports brotli. - Added an
accept!
macro similar to amatch
expression that chooses a block depending on the value of theAccept
header of the request. - Added
proxy::full_proxy
. It behaves the same asproxy
but returns more status codes and less errors. - Added
Response::from_data
,from_file
,with_content_disposition_attachment
,empty_406
,with_public_cache
,with_private_cache
,with_no_cache
,without_header
,with_additional_header
andwith_unique_header
for easier response manipulation. - Added
Request::headers()
that provides an iterator to the list of headers. - Added
input::priority_header_preferred
andinput::parse_priority_header
to easily parse request headers such asAccept
orAccept-Language
. - MIME types that contain "font" are now also compressed by the
content_encoding
module. - Changed
text/xml
toapplication/xml
in the MIME types auto-determination.
- Added a
Server
struct as an alternative tostart_server
for manual control over the behavior. - Added a
content_encoding::apply
function that appliesContent-Encoding
to a response. - The
try_or_400!
macro now returns a response whose body describes the error in JSON. - The
try_or_400!
macro now requires the error to implement thestd::error::Error
trait.
- Added support for websockets with the
websocket
module. - Added
Request::do_not_track()
to query the DNT header. - Renamed
get_json_input()
tojson_input()
. - Renamed
get_cookies()
tocookies()
. - Renamed
get_basic_http_auth()
tobasic_http_auth()
. - The logs now show the time of the start of the request processing.
Request::header()
now returns aOption<&str>
instead ofOption<String>
.Response::svg()
andResponse::html()
now take aInto<String>
instead of aInto<Vec<u8>>
.- Renamed
Response::error()
andsuccess()
tois_error()
andis_success()
. - The
headers
field ofResponse
are nowVec<(Cow<'static, str>, Cow<'static, str>)>
instead ofVec<(String, String)>
. - Removed
Response::redirect
and replaced it withredirect_301
,redirect_302
, etc. - Added
Response::with_etag()
to add an ETag header to a response. - Added an
upgrade
field toResponse
, necessary for websockets. - Fixed being able to set the value of the Content-Length and Transfer-Encoding headers.
plain_text_body
now has a limit of 1 MB of data before returning an error.- Added
plain_text_body_with_limit
which does the same asplain_text_body
but with a customizable limit. - Implemented the
std::error::Error
trait on all error types. - Added
Response::into_reader_and_size()
to retreive aRead
object from aResponseBody
. - Fixed issue with static files not being found on Windows because of
/
and\
mismatch.
- Added the
proxy
module with basic reverse proxy.
- Added the
rouille::input::plain_text_body
function.
- Empty Vecs are now allowed for POST input.
- Reworked POST input. You can now use the
post_input!
macro instead of creating a decodable struct. - Removed the
input::session
module and replaced it with thesession
module. Sessions no longer store data in a hashmap, but instead only provide a way to generate a unique ID per client.
- Fixed the
+
character in the query string not being replaced with a space as it should. Request::data()
now returns anOption<impl Read>
instead of aVec<u8>
. Ifdata()
is called twice, the second call will returnNone
.RouteError
has been removed. You are now encouraged to return aResponse
everywhere instead of aResult<Response, RouteError>
.- The
try_or_400!
,find_route!
andassert_or_4OO!
macros and thematch_assets
function have been adjusted for the previous change. - Added a
try_or_404!
macro similar totry_or_400!
. - In the case of a panic, the response with status code 500 that the server answers now contains a small text in its body, indicating the user that an internal server error occured.
- Added
Response::empty_400()
,Response::empty_404()
,Response::success()
andResponse::error()
.