Skip to content

Commit

Permalink
fix: Fill GRPC_CONTENT_TYPE when handing recover errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Manphil committed Dec 7, 2024
1 parent a22b61d commit 5bbb206
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tonic/src/transport/server/service/recover_error.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use crate::metadata::GRPC_CONTENT_TYPE;
use crate::Status;
use http::Response;
use http_body::Frame;
Expand Down Expand Up @@ -67,6 +68,8 @@ where
Err(err) => match Status::try_from_error(err) {
Ok(status) => {
let mut res = Response::new(MaybeEmptyBody::empty());
res.headers_mut()
.insert(http::header::CONTENT_TYPE, GRPC_CONTENT_TYPE);
status.add_header(res.headers_mut()).unwrap();
Poll::Ready(Ok(res))
}
Expand Down

0 comments on commit 5bbb206

Please sign in to comment.