diff --git a/tower-http/CHANGELOG.md b/tower-http/CHANGELOG.md index b2edf735..4b77551a 100644 --- a/tower-http/CHANGELOG.md +++ b/tower-http/CHANGELOG.md @@ -7,6 +7,48 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 # Unreleased +# 0.6.11 + +## Added + +- `set-header`: add `SetMultipleResponseHeadersLayer` and + `SetMultipleResponseHeader` for setting multiple response headers at once. + Supports `overriding`, `appending`, and `if_not_present` modes. Header + values can be fixed or computed dynamically via closures ([#672]) + + ```rust + use http::{Response, header::{self, HeaderValue}}; + use http_body::Body as _; + use tower_http::set_header::response::SetMultipleResponseHeadersLayer; + + let layer = SetMultipleResponseHeadersLayer::overriding(vec![ + (header::X_FRAME_OPTIONS, HeaderValue::from_static("DENY")).into(), + (header::CONTENT_LENGTH, |res: &Response| { + res.body().size_hint().exact() + .map(|size| HeaderValue::from_str(&size.to_string()).unwrap()) + }).into(), + ]); + ``` +- `classify`: add `From` and `From` impls for `GrpcCode`. + Unrecognized status codes map to `GrpcCode::Unknown` ([#506]) + +## Changed + +- `compression`: compress `application/grpc-web` responses. Previously all + `application/grpc*` content types were excluded from compression; now only + `application/grpc` (non-web) is excluded ([#408]) + +## Fixed + +- `fs`: fix `ServeDir` returning 500 instead of 405 for non-GET/HEAD requests + when `call_fallback_on_method_not_allowed` is enabled but no fallback service + is configured ([#587]) + +[#408]: https://github.com/tower-rs/tower-http/pull/408 +[#506]: https://github.com/tower-rs/tower-http/pull/506 +[#587]: https://github.com/tower-rs/tower-http/pull/587 +[#672]: https://github.com/tower-rs/tower-http/pull/672 + # 0.6.10 ## Added diff --git a/tower-http/Cargo.toml b/tower-http/Cargo.toml index 6c52afd2..0cb95bf4 100644 --- a/tower-http/Cargo.toml +++ b/tower-http/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "tower-http" description = "Tower middleware and utilities for HTTP clients and servers" -version = "0.6.10" +version = "0.6.11" authors = ["Tower Maintainers "] edition = "2018" license = "MIT"