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.
In plain terms
- 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.
Must act Top 5 of 15 that need code or config changes
What you must change
Breaking8
AsyncResult::async is renamed to AsyncResult::future because async is a reserved keyword in the 2018 edition.AsyncResult::asyncAsyncResult::futureRemoves
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()HttpRequestHttpRequest::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()StaticFilesSecurity3
Out-of-bounds Write in actix-web
ModerateOut-of-bounds Write in actix-web
ModerateMultiple memory safety issues in actix-web
ModeratePlatform1
Raises the minimum supported Rust version to 1.26.
Deprecations to plan for
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()