Skip to content

Wrong content type in response headers for unary rpc calls while using envoy grpc transcoder #41593

@Mrida

Description

@Mrida

Title: text/eventstream content type in response headers for unary rpc calls while using grpc transcoder

Description:
I expect content type to be set to text/eventstream only for streamed rpc calls, while it is being applied also to unary rpc calls.

Repro steps:
Add grpc transcoder filter and include a unary method in the proto file.
Call the endpoint through envoy.
The content type in the response headers is text/eventstream while it is expected to be application/json

Notes:
Checking the code, the content type is set to text/eventstream without checking if the method called is a streaming method.

  if (per_route_config_->isStreamSSEStyleDelimited()) {
    headers.setContentType(Http::Headers::get().ContentTypeValues.TextEventStream);
  } else {
    headers.setReferenceContentType(Http::Headers::get().ContentTypeValues.Json);
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions