Repository navigation
·
110 commits
to main
since this release
Library crate: install from crates.io (fastapi-rust = "0.6.0", with asupersync = { version = "0.7", default-features = false }). All eight fastapi-* crates (fastapi-types, fastapi-macros, fastapi-output, fastapi-router, fastapi-openapi, fastapi-core, fastapi-http, fastapi-rust) are published at 0.6.0. Prebuilt .rlib archives are not attached.
A breaking release moving the async runtime to asupersync 0.7, hardening HTTP/1.1 head admission, request read deadlines, and HTTP/2 prior-knowledge controls, wiring per-App registered exception handlers into macro and fluent routes and extractors, and refreshing dependencies to zero cargo audit vulnerabilities.
Migrating from 0.5.x
- asupersync 0.5 -> 0.7 (d265d45, e7cb834):
Depend onasupersync = { version = "0.7", default-features = false }alongsidefastapi-rust = "0.6.0". MSRV remains Rust 1.95. IntoResponse for Result<T, E>requiresE: 'static(3e87de2) so registered exception handlers can perform exact-type lookup onErr(E)viaIntoResponse::into_response_with_context. All built-in error and extractor rejection types are already'static.
Added and Fixed
- Per-
Appexception handlers wired to route errors and extractor rejections (3e87de2):
App::handlebridgesArc<ExceptionHandlers>into request extensions before middleware execution. Macro routes (#[get],#[post], etc.) and fluent routes (AppBuilder::get/post/...,RouteEntry::new) now dispatchResult<T, E>errors (including type aliases and-> impl IntoResponse) and outerFromRequest::Errorrejections to exact-type registered handlers before middlewareafter()hooks and dependency cleanups run. Unregistered errors retain theirIntoResponsefallback, explicitResponsevalues are never reinterpreted, andOption<T>extractors continue to swallow extraction failures asNone. - HTTP/1.1 head admission, read deadlines, and protocol hardening (c0f054d, 2498d3f, 6d9b4ca, 638b442, 84fb342, 92a9dcd, 3e1f04f):
- Validate request heads before reading request bodies and gate
Expect: 100-continue(ignoring100-continueon HTTP/1.0). - Bound total request-body reads and leading blank lines against the request read deadline, returning
408 Request Timeouton expiry. - Answer every refused request cleanly, serve short requests whole, reject non-token HTTP methods, and allow servers to disable HTTP/2 prior-knowledge (
h2c) negotiation (ServerConfig::with_http2_prior_knowledge(false)). - Extend real-TCP head admission coverage to
serve_on_app_concurrent.
- Validate request heads before reading request bodies and gate
- Installer and scaffolding fixes (d90732a, acd6a49):
install.shruns cleanly under stock macOS Bash 3.2 (guarding empty arrays underset -u) and scaffoldsfastapi-rust = "0.6.0"withasupersync = { version = "0.7", default-features = false }.
Dependencies, Security, and Build
- Tokio-free lockfile policy enforced by test (da70f7f):
Restored the heldwasm-bindgen-futures 0.4.78family and addedcrates/fastapi/tests/lock_policy.rssotokiocannot re-enterCargo.lock. - Dependency and security refresh — 0
cargo auditvulnerabilities (08f7251, 0a18547, d265d45, e7cb834):
Upgradedasupersyncto 0.7.0,rich_rustto 0.2.4,parking_lotto 0.13.0,proptestto 1.12.0,ctutilsto 0.4.8 (RUSTSEC-2026-0385),pulldown-cmarkto 0.13.6 (RUSTSEC-2026-0433,RUSTSEC-2026-0414),rustixto 1.1.6 (RUSTSEC-2026-0486),serde_jsonto 1.0.154,flate2to 1.1.11,synto 3.0.10,regexto 1.13.2, andunicode-widthto 0.2.3. SeeUPGRADE_LOG.md. - Workspace release profile configured (acd6a49):
Explicitopt-level = 3,lto = true,codegen-units = 1,strip = true.