-
Notifications
You must be signed in to change notification settings - Fork 711
HTTPHeaderFilter processing doesn't correctly support multiple header values. #4023
Copy link
Copy link
Closed
Labels
Description
Description:
The documentation for HTTPHeaderFilter contains this statement:
Configuration to set or add multiple values for a header must use RFC 7230 header value formatting, separating each value with a comma.
My expectation that adding a header via Envoy Gateway's route filters with a comma-delimited value would add the header in the same way that specifying the header multiple times with curl would do.
Repro steps:
-
Deploy the quickstart example
-
Apply the following
HTTPRoute:apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: name: backend namespace: default spec: hostnames: - www.example.com parentRefs: - group: gateway.networking.k8s.io kind: Gateway name: eg rules: - backendRefs: - group: "" kind: Service name: backend port: 3000 weight: 1 filters: - requestHeaderModifier: add: - name: add-header value: foo,bar type: RequestHeaderModifier matches: - path: type: PathPrefix value: /
-
Run the following
curlcommand:curl http://${ENVOY_GATEWAY_IP}/headers -H 'Host: www.example.com' -H 'Test: one' -H 'Test: two'
Compare the header
Add-Headerand the headerTestin the output:{ "path": "/headers", "host": "www.example.com", "method": "GET", "proto": "HTTP/1.1", "headers": { "Accept": [ "*/*" ], "Add-Header": [ "foo,bar" ], "Test": [ "one", "two" ], }, "namespace": "default", "ingress": "", "service": "", "pod": "backend-96f75bbf-778l6" }
Reactions are currently unavailable