fix(deps): update rust crate tower-http to 0.7 - autoclosed #349
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "renovate/tower-http-0.x"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR contains the following updates:
0.6→0.7Release Notes
tower-rs/tower-http (tower-http)
v0.7.1Compare Source
Added
fs: addServeDir::redirect_to_trailing_slash()to serve directory indexes directly instead of first redirecting to the trailing-slash path. The redirect remains the default (#728)fs: addignore_multi_range_requests()toServeDirandServeFile, serving the full representation when a request asks for multiple byte ranges. The existing416 Range Not Satisfiableresponse remains the default (#727)request-id: the constructors and accessors on the request-id layers, services, andRequestIdare nowconst fn, so they can be used in const context (#716)Changed
fs: the minimumhttp-range-headerrequirement is now 0.4.2 (#661)Fixed
fs: makeServeDir::try_callpropagate expected filesystemI/O errors when no fallback is configured, as documented, instead of converting
them to
404 Not Foundresponses (#718)decompression: don't end the body when a data frame with no remaining bytesarrives after the decompressor reports end-of-stream. Trailers following such a
frame were dropped and could not be recovered (#722)
decompression: return a body error when a data frame with remaining bytesarrives after the decompressor reports end-of-stream, rather than silently
truncating. This regressed in 0.7.0 (#712)
fs: multipart range requests are now rejected before range validation, sothey consistently return
416 Range Not Satisfiablewith aCannot serve multipart range requestsbody instead of a genericunsatisfiable-range response (#661)
fs: range error responses no longer carry representation headers such asContent-TypeandContent-Encoding(#727)set-header:SetMultipleResponseHeadersLayerandSetMultipleResponseHeaderare now
Cloneregardless of the response body type, matching the fix appliedto the request-side types in 0.7.0 (#714)
All the changes
New Contributors
v0.7.0Compare Source
Changes since 0.6.11
Added
csrf: add cross-site request forgery (CSRF) protection middleware, porting the cross-origin protection scheme introduced in Go 1.25 (#699)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.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)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
breaking:
compression: the middleware now handles the*wildcard andidentity;q=0in Accept-Encoding per RFC 9110 §12.5.3. Requests that previously fell back to identity (e.g.*;q=0oridentity;q=0with no other acceptable encoding) now receive a 406 Not Acceptable response. Clients that explicitly reject all encodings without listing an alternative will see different behavior. (#693)breaking:
compression: upgrade theSizeAbovepredicate threshold fromu16tou64, allowing minimum sizes above 64 KiB (#704)breaking: remove the implicit no-op
tokioandasync-compressionfeatures. These were kept as no-op features in 0.6.x for backwards compatibility after the switch todep:syntax in #642. Downstream crates that activatetower-http/tokioortower http/async-compressionshould remove those feature entries; the underlying dependencies are still pulled in transitively by the features that need them (e.g.compression-gzip,fs,timeout). (#628)breaking:
trace/classify: include the gRPC error message in tracing output.GrpcCodeandGrpcFailureClassare now#[non_exhaustive], andGrpcStatusis exported from theclassifymodule (#422)breaking:
follow-redirect:FollowRedirectnow forwards requestExtensionsto redirected requests instead of dropping them. TheStandardpolicy drops extensions on cross-origin redirections (same-origin keeps them). Opt out withFollowRedirectLayer::preserve_extensions(false); keep specific types withFilterCredentials::allow_extension::<T>()or all of them withkeep_all_extensions(). (#706)breaking:
follow-redirect: header and extension filtering is now cumulative. A value a policy drops on one hop is no longer replayed on later hops, soFilterCredentialsno longer re-sendsCookie/Authorizationto a same-origin target reached after cross-origin hop. CustomPolicy::on_requestimpls now see the previous hop's filtered request, not the original. (#706)trace:DefaultOnRequest,DefaultOnResponse,DefaultOnFailure, andDefaultOnEosnow explicitly parent their tracing events to the request span rather than relying on the ambient span context. This fixes intermittent cases where events could appear without their request span attached (#690)cors: relax theVaryheader defaults (#674)MSRV bumped from 1.64 to 1.65 (#684)
Fixed
fs:ServeDirandServeFilenow emit aVary: Accept-Encodingresponseheader when precompressed serving is configured, ensuring caches correctly
distinguish between compressed and uncompressed variants (#692)
services: reject a trailing slash for file paths. File requests with a trailing slash now return404 Not Foundinstead of serving the file (#678)fs: fixServeDirstripping the file extension when serving with identity encoding (#686)compression: forward trailers from the inner body after compression finishes, fixing dropped gRPC status trailers (#685)trace: fireon_eoswhen the inner body reportsis_end_streamwith a precise content-length (#687)on-early-drop: suppress the early-drop guard whenis_end_streamis reported after a data frame (#687)set-header: makeSetMultipleRequestHeadersandSetMultipleResponseHeadersClonefor non-CloneHTTP bodies (#703)Thanks
New Contributors
Configuration
📅 Schedule: (in timezone Europe/Amsterdam)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate CLI.
On hold (hold): this PR does not merge by itself. Reply
mergehere and it merges as soon as the checks pass.Title
fix(deps): update rust crate tower-http to 0.7
PR Type
dependencies
Description
Updates
tower-httpcrate from version 0.6 to 0.7Enables new features like trailing slash redirects and multi-range handling
Adjusts dependency constraints for updated
http-range-headerrequirementDiagram Walkthrough
File Walkthrough
Cargo.toml
Upgrade tower-http crate to latest minor versionserver/Cargo.toml
tower-httpdependency version from 0.6 to 0.7fs,trace,set-header/review
PR Reviewer Guide 🔍
Here are some key observations to aid the review process:
🧹 Lint report · ✅ all 25 checks clean
Errors below fail this check.
✅ Clean: black, checkstyle, djlint, editorconfig-checker, git_diff, gitleaks, grype, hadolint, htmlhint, isort, jsonlint, markdownlint, npm-groovy-lint, pmd, prettier, prettier, ruff, secretlint, shellcheck, shfmt, stylelint, trivy, trufflehog, xmllint, yamllint
MegaLinter on soucouyant · full logs in the Actions run · comment
/improvefor AI fix suggestionsfix(deps): update rust crate tower-http to 0.7to fix(deps): update rust crate tower-http to 0.7 - autoclosedPull request closed