deps: bump tower-http from 0.6.11 to 0.7.0
Bumps tower-http from 0.6.11 to 0.7.0.
Release notes
Sourced from tower-http's releases.
tower-http-0.7.0
Added
csrf: add cross-site request forgery (CSRF) protection middleware, porting the cross-origin protection scheme introduced in Go 1.25 (#699)use tower::ServiceBuilder; use tower_http::csrf::CsrfLayer;// Rejects cross-origin state-changing requests using
Sec-Fetch-Site,
// anOriginallow-list, and anOrigin/Hostfallback. No per-request
// token state required.
let layer = CsrfLayer::new().add_trusted_origin("https://example.com")?;
let service = ServiceBuilder::new().layer(layer).service_fn(handler);
timeout: addDeadlineBodyfor non-resetting body timeouts, applied via the newRequestBodyDeadlineLayerandResponseBodyDeadlineLayer(#688)Unlike
TimeoutBody, which resets its deadline on every frame,DeadlineBodycaps the total time of a body transfer. A slow client trickling one byte at a time never trips an idle timeout but will trip a deadline.use std::time::Duration; use tower::ServiceBuilder; use tower_http::timeout::RequestBodyDeadlineLayer;
// Abort the request body transfer after 30s total, regardless of how
// frequently data arrives.
let service = ServiceBuilder::new()
.layer(RequestBodyDeadlineLayer::new(Duration::from_secs(30)))
.service_fn(handler);
fs: add strongETagsupport toServeDir, includingIf-MatchandIf-None-Matchprecondition handling per RFC 9110.304 Not Modifiedresponses now carry theETagandLast-Modifiedvalidators (#691)
fs: add aBackendtrait to makeServeDirwork with non-filesystem sources (e.g. embedded assets or object storage). The defaultTokioBackendpreserves existing behavior. UseServeDir::with_backend()to plug in custom implementations (#684)use tower_http::services::fs::ServeDir;
//MyBackendimplementstower_http::services::fs::Backend.
// The defaultServeDir::new()continues to useTokioBackend(local FS).
let service = ServeDir::with_backend("assets", MyBackend::new());
fs: addhtml_as_default_extensionoption toServeDir, appending.htmlwhen the request path has no extension (#519)
fs: addredirect_path_prefixoption toServeDir, prepending a prefix on trailing-slash redirects so the service can be mounted under a sub-path (#486)
validate-request: addValidateRequestHeaderLayer::has_header_value()to reject requests when a header does not have an expected value (#360)
body:UnsyncBoxBody::new()constructor andFrom<ServeFileSystemResponseBody>conversion to avoid double-boxing when combiningServeDirresponses with other body types (#537)
limit: implementDefaultforlimit::ResponseBodywhen the wrapped body also implementsDefault(#679)Changed
... (truncated)
Commits
b194fcfv0.7.0af828a6feat(follow_redirect)!: preserve request extensions across redirects (#706)8cb8d99feat(ValidateRequestHeaderLayer): add has_header("...").with_value("...") fun...3b56d2dfeat!: Add configurable Backend trait for ServeDir, bump MSRV 1.65 (#684)8508716Addredirect_path_prefixoption (#486)56327b2Add Windows drive-prefix path regression test (#705)54c6db8feat(compression)!: upgrade SizeAbove threshold from u16 to u64 (#704)68cd6d8Add DeadlineBody for non-resetting body timeouts (#688)fa8a98cfeat(fs): add strong ETag support to ServeDir (#691)36d2205fix: Make SetMultiple*Header Clone for !Clone http bodies (#703)- Additional commits viewable in compare view
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebasewill rebase this PR@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it@dependabot show <dependency name> ignore conditionswill show all of the ignore conditions of the specified dependency@dependabot ignore this major versionwill close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor versionwill close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependencywill close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Summary by cubic
Upgrade tower-http to 0.7.0 across the workspace to stay current and keep cors/trace working as before. No code changes expected.
-
Dependencies
- Bumped
tower-httpto0.7.0in root,crates/convex-mcp, andcrates/convex-server. - Updated
Cargo.lock(a transitive dep still pullstower-http 0.6.11, which is fine).
- Bumped
-
Migration
- Ensure Rust toolchain is >= 1.65 (MSRV increased by
tower-http0.7).
- Ensure Rust toolchain is >= 1.65 (MSRV increased by