Skip to main content

Actix 4.20.0

Release Date: November 17, 2026

Actix Web 4.20.0 was released on November 17, 2026. The release adds one framework-level change: a guard_obj parameter on route attribute macros. The crate ships alongside actix-web-codegen 4.6.0, actix-http 3.22.0, actix-router 0.5.5, actix-multipart 0.8.9, and actix-files 0.7.5, which together carry the security and protocol work of this cycle.

Overview

Version 4.20.0 focuses on macro ergonomics rather than runtime behavior. The minimum supported Rust version remains 1.89, set in the 4.18.0 cycle. No public API was removed in this release.

New Features

  • guard_obj on route macros: every route attribute macro that accepts guard now also accepts guard_obj, allowing any expression that evaluates to a Guard instead of only a path to a guard function. This makes guards built at runtime, or composed from captured state, usable directly in the attribute.
  • Automatic cleartext HTTP/2 detection (4.19.0): HttpServer::bind() and listen() detect prior-knowledge h2c automatically when the http2 feature is enabled, and HttpServer::auto_h2c(bool) controls the behavior explicitly.
  • TCP_NODELAY enabled by default (4.19.0), reducing latency for small responses at the cost of slightly more packets.

Breaking Changes and Deprecations

  • HttpServer::bind_auto_h2c() and listen_auto_h2c() are deprecated in favor of auto_h2c(bool). Existing calls still compile with a warning.
  • Since 4.16.0, TLS crate features no longer imply the http2 crate feature. Projects that relied on the implicit enablement must add http2 explicitly.
  • Since 4.18.2, decompressed request payloads are bounded by the same configured size limits applied to the form, JSON, bytes, and string extractors.

Security and Protocol Hardening

The actix-http releases in this window close three advisories. Header parsing handles quoted-pairs in chunk extensions and rejects invalid control bytes inside quoted strings (GHSA-9543-cj4x-h76q). The request head timeout now applies to pipelined HTTP/1.1 partial requests on keep-alive connections (GHSA-54pm-2wm5-hpmg). Bare LF is rejected as a trailer terminator after chunked encoding (GHSA-9w4r-xc43-v236). Payload decompression is bounded (GHSA-qph8-7859-gq2f) to prevent decompression-based resource exhaustion.

actix-files 0.7.5 rejects malformed byte positions in Range headers, and actix-multipart 0.8.9 responds with 413 Payload Too Large when a payload overflow error occurs during multipart parsing.

Fixes and Improvements

  • Accept parsing and preference selection handle quality parameters placed before media type parameters, and quoted parameter values containing semicolons (4.17.0).
  • Multipart form configuration gained max_parts() with a default global limit of 100 parts, plus the #[multipart(max_parts = 10)] derive attribute; the lower of the form and global limits applies (actix-multipart 0.8.7).
  • ContentDisposition::attachment() emits a UTF-8 encoded filename* parameter for non-ASCII filenames.
  • The built-in app default returns 405 with an Allow header when method guards reject otherwise matching resources, including macro routes.
  • The #[query] route macro, method = "QUERY" support in #[route], and the guard::Query() guard arrived in 4.18.0.
  • Dependencies updated: zstd 0.14 and brotli 9 (4.17.0), foldhash 0.2 and rand 0.10 (4.14.0).

Upgrade Notes

Update actix-web to 4.20.0 and let Cargo resolve the matching actix-http and actix-router releases; the security fixes in actix-http 3.21.x and 3.22.0 are the reason not to pin the older versions. If you serve cleartext HTTP/2 through the deprecated auto-h2c helpers, migrate to auto_h2c(bool). If response latency on small payloads changed after upgrading from 4.18, that is the default TCP_NODELAY taking effect, not a regression.

Other Versions

We use cookies for ads and analytics.