Open
Description
Description:
I cannot set
Cache-Control: foo,bar
with ResponseHeaderModifier
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:
- responseHeaderModifier:
set:
- name: Cache-Control
value: private, no-store
type: ResponseHeaderModifier
matches:
- path:
type: PathPrefix
value: /
- Run the following curl command:
curl -i http://${ENVOY_GATEWAY_IP}/-H 'Host: www.example.com' -H 'X-Echo-Set-Header: Cache-control: value1' | grep ^cache-control
You will see This:
cache-control: no-store
Expected output:
cache-control: private, no-store
Proxy config extract:
"response_headers_to_add": [
{
"header": {
"key": "Cache-Control",
"value": "private"
},
"append_action": "OVERWRITE_IF_EXISTS_OR_ADD"
},
{
"header": {
"key": "Cache-Control",
"value": " no-store"
},
"append_action": "OVERWRITE_IF_EXISTS_OR_ADD"
}
],