Skip to content

Upgrading actix-web 0.6 to 0.7

Breaking0.6.15 → 0.7.19Breaking8Security3Platform1Deprecated3New37Changed21Fixed42

BreakingUpgrade verdict

8 breaking changes and a platform requirement change and 3 security fixes.

  • Code calling the old method name must switch to the new one.
  • The two- and three-extractor route helpers are gone; combine extractors into a tuple instead.
  • The range helper on HTTP messages has been removed.
  • Handler::handle() now takes &self instead of &mut self for safety and performance.
Top 5 of 15 that need code or config changes
Breaking8
AsyncResult::async is renamed to AsyncResult::future because async is a reserved keyword in the 2018 edition.
AsyncResult::asyncAsyncResult::future
Removes Route::with2() and Route::with3(); use a tuple of extractors instead.
Route::with2()Route::with3()
Removes HttpMessage::range().
HttpMessage::range()
Handler::handle() now takes &self instead of &mut self for safety and performance.
Handler::handle()
Handler::handle() now takes &HttpRequest instead of HttpRequest.
Handler::handle()HttpRequest
HttpRequest::query() now returns Ref<HashMap<String, String>> instead of its previous return type.
HttpRequest::query()
HttpRequest::cookies() now returns Ref<Vec<Cookie<'static>>> instead of its previous return type.
HttpRequest::cookies()
StaticFiles::new() now returns Result<StaticFiles<S>, Error> instead of StaticFiles<S>.
StaticFiles::new()StaticFiles
Security3
Out-of-bounds Write in actix-web
Moderate
Out-of-bounds Write in actix-web
Moderate
Multiple memory safety issues in actix-web
Moderate
Platform1
Raises the minimum supported Rust version to 1.26.
Deprecated3
Deprecates HttpServer::no_http2() in favor of OpensslAcceptor::with_flags() or RustlsAcceptor::with_flags().
HttpServer::no_http2()OpensslAcceptor::with_flags()RustlsAcceptor::with_flags()
Deprecates HttpServer::listen_tls(), listen_ssl() and listen_rustls() in favor of HttpServer::listen_with() with a specific acceptor.
HttpServer::listen_tls()HttpServer::listen_ssl()HttpServer::listen_rustls()HttpServer::listen_with()
Deprecates HttpServer::bind_tls(), bind_ssl() and bind_rustls() in favor of HttpServer::bind_with() with a specific acceptor.
HttpServer::bind_tls()HttpServer::bind_ssl()HttpServer::bind_rustls()HttpServer::bind_with()