Skip to content

HTTPProxy requestHeadersPolicy fails to deduplicate merged Content-Type headers for Spring Boot backends. #7452

@amanas91

Description

@amanas91

Hi Team,

I am migrating from a standard Kubernetes Ingress controller to Contour v1.33.2. My upstream application is a Spring Boot service.
When a client sends duplicate Content-Type headers (e.g., two instances of application/json), Envoy merges them into a single comma-separated string: application/json,application/json.
This causes the Spring application to crash with an org.springframework.http.InvalidMediaTypeException because it cannot parse the comma-separated value as a valid MimeType.

The Problem:
Even when using requestHeadersPolicy to remove and then set the header, the backend still receives the merged/invalid string. It appears the header manipulation is not successfully overriding the merged Envoy string before it reaches the upstream service.

Config Used:
yaml
requestHeadersPolicy:
remove:
- Content-Type
set:
- name: Content-Type
value: application/json

I would like to how can we fix this issue in contour, as we did not face this issue in existing k8s ingress controller.

i have contour, envoy running as deployment and certgen job fyi in terms of env set up.

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