Skip to content

Commit

Permalink
poem-grpc 0.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
sunli829 committed Sep 12, 2024
1 parent 1bb87fe commit a584e51
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
4 changes: 4 additions & 0 deletions poem-grpc/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion poem-grpc/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10 changes: 7 additions & 3 deletions poem-grpc/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -401,11 +401,15 @@ fn create_http_request<T: Codec>(
.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",
Expand Down

0 comments on commit a584e51

Please sign in to comment.