diff --git a/poem-grpc/CHANGELOG.md b/poem-grpc/CHANGELOG.md index 88ab5917bc..490e3f4792 100644 --- a/poem-grpc/CHANGELOG.md +++ b/poem-grpc/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +# [0.5.1] 2024-09-12 + +- set the correct `content-type` for `GrpcClient` + # [0.5.0] 2024-09-08 - add support for GRPC compression diff --git a/poem-grpc/Cargo.toml b/poem-grpc/Cargo.toml index 01a6aa3a12..6094f48ca3 100644 --- a/poem-grpc/Cargo.toml +++ b/poem-grpc/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "poem-grpc" -version = "0.5.0" +version = "0.5.1" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/poem-grpc/src/client.rs b/poem-grpc/src/client.rs index f5ff77c46c..da9861e2a9 100644 --- a/poem-grpc/src/client.rs +++ b/poem-grpc/src/client.rs @@ -401,11 +401,15 @@ fn create_http_request( .uri_str(path) .method(Method::POST) .version(Version::HTTP_2) - .content_type(T::CONTENT_TYPES[0]) - .header(header::TE, "trailers") .finish(); - http_request.headers_mut().extend(metadata.headers); + *http_request.headers_mut() = metadata.headers; *http_request.extensions_mut() = extensions; + http_request + .headers_mut() + .insert("content-type", T::CONTENT_TYPES[0].parse().unwrap()); + http_request + .headers_mut() + .insert(header::TE, "trailers".parse().unwrap()); if let Some(send_compressd) = send_compressd { http_request.headers_mut().insert( "grpc-encoding",