github actix/actix-web v0.7.0
Actix web 0.7.0

latest releases: web-v4.5.1, actors-v4.3.0, test-v0.1.3...
5 years ago

Changes

Added

  • Add fs::StaticFileConfig to provide means of customizing static
    file services. It allows to map mime to Content-Disposition,
    specify whether to use ETag and Last-Modified and allowed methods.

  • Add .has_prefixed_resource() method to router::ResourceInfo
    for route matching with prefix awareness

  • Add HttpMessage::readlines() for reading line by line.

  • Add ClientRequestBuilder::form() for sending application/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
    to fs::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::* as actix_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 of HttpRequest

  • Added header User-Agent: Actix-web/<current_version> to default headers when building a request

  • port Extensions type from http create, we don't need Send + Sync

  • HttpRequest::query() returns Ref<HashMap<String, String>>

  • HttpRequest::cookies() returns Ref<Vec<Cookie<'static>>>

  • StaticFiles::new() returns Result<StaticFiles<S>, Error> instead of StaticFiles<S>

  • StaticFiles uses the default handler if the file does not exist

Removed

  • Remove Route::with2() and Route::with3() use tuple of extractors instead.

  • Remove HttpMessage::range()

Don't miss a new actix-web release

NewReleases is sending notifications on new releases.