Changes
Added
-
Add
fs::StaticFileConfig
to provide means of customizing static
file services. It allows to mapmime
toContent-Disposition
,
specify whether to useETag
andLast-Modified
and allowed methods. -
Add
.has_prefixed_resource()
method torouter::ResourceInfo
for route matching with prefix awareness -
Add
HttpMessage::readlines()
for reading line by line. -
Add
ClientRequestBuilder::form()
for sendingapplication/x-www-form-urlencoded
requests. -
Add method to configure custom error handler to
Form
extractor. -
Add methods to
HttpResponse
to retrieve, add, and delete cookies -
Add
.set_content_type()
and.set_content_disposition()
methods
tofs::NamedFile
to allow overriding the values inferred by default -
Add
fs::file_extension_to_mime()
helper function to get the MIME
type for a file extension -
Add
.content_disposition()
method to parse Content-Disposition of
multipart fields -
Re-export
actix::prelude::*
asactix_web::actix
module. -
HttpRequest::url_for_static()
for a named route with no variables segments -
Propagation of the application's default resource to scopes that haven't set a default resource.
Changed
-
Min rustc version is 1.26
-
Use tokio instead of tokio-core
-
CookieSessionBackend
sets percent encoded cookies for outgoing HTTP messages. -
Became possible to use enums with query extractor.
Issue #371.
Example -
HttpResponse::into_builder()
now moves cookies into the builder
instead of dropping them -
For safety and performance reasons
Handler::handle()
uses&self
instead of&mut self
-
Handler::handle()
uses&HttpRequest
instead ofHttpRequest
-
Added header
User-Agent: Actix-web/<current_version>
to default headers when building a request -
port
Extensions
type from http create, we don't needSend + Sync
-
HttpRequest::query()
returnsRef<HashMap<String, String>>
-
HttpRequest::cookies()
returnsRef<Vec<Cookie<'static>>>
-
StaticFiles::new()
returnsResult<StaticFiles<S>, Error>
instead ofStaticFiles<S>
-
StaticFiles
uses the default handler if the file does not exist
Removed
-
Remove
Route::with2()
andRoute::with3()
use tuple of extractors instead. -
Remove
HttpMessage::range()