Skip to content

Missing Content-Type Field #431

@callensm

Description

@callensm

Bug Report

Version

[dependencies]
prost = "0.6"
tonic = "0.3"
tonic-health = "0.2"

[build-dependencies]
tonic-build = "0.3"

Platform

Darwin MacBook Pro 19.5.0 Darwin Kernel Version 19.5.0

Description

I'm using the tonic_health service and a lightweight gRPC service and the servers are standing up fine and when I make a call to it with grpcurl, the protocol responds back with the appropriate message.

However, when I try to tie the server into an ecosystem that utilizes it and the health service, I keep getting:

* rpc error: code = Unknown desc = OK: HTTP status code 200; transport: missing content-type field

I've tried manually appending the content-type field to the response metadata as both application/grpc and application/grpc+proto as:

let mut res = Response::new(msg);
res.metadata_mut().append(
  "content-type",
  metadata::MetadataValue::from_str("application/grpc").unwrap(),
);
Ok(res)

but this still doesn't resolve the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions