envoyproxy / envoyproxy/gateway

Unable to set or at least view additional http response headers via ResponseHeaderModifier

Ouverte
#5,216 2 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
stale triage
Langage dominant
Go
Étoiles
3k
Forks
864
Merge moyen
2 j 2 h
PR mergées (30 j)
140

Description

*Description*:
I am setting a filter `ResponseHeaderModifier` for an HTTPRoute resource but am not seeing the additional headers in the response with a verbose output.

Here is a snippet of the configuration
```
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
...
filters:
- type: ResponseHeaderModifier
responseHeaderModifier:
add:
- name: Content-Security-Policy
value: default-src 'self'
- name: Strict-Transport-Security
value: max-age=31536000; includeSubDomains; preload
- name: X-Content-Type-Options
value: nosniff
```

Then `curl -v ` returns

```
* Request completely sent off
< HTTP/1.1 200 OK
< Content-Type: application/json; charset=utf-8
< Date: Wed, 05 Feb 2025 18:49:12 GMT
< Content-Length: 7
```

I would have expected but I may be misunderstanding the filter modifier?

```
* Request completely sent off
< HTTP/1.1 200 OK
< Content-Type: application/json; charset=utf-8
< Date: Wed, 05 Feb 2025 18:49:12 GMT
< Content-Length: 7
< Content-Security-Policy: default-src 'self'
< Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
< X-Content-Type-Options: nosniff
```

[optional *Relevant Links*:]
[Envoy proxy adding response headers](https://gateway.envoyproxy.io/docs/tasks/traffic/http-response-headers/#adding-response-headers)

Using envoy v 1.1.x

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.