envoyproxy / envoyproxy/gateway

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

Aperta
#5,216 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
stale triage
Lingua principale
Go
Stelle
3k
Fork
864
Merge medio
2g 2h
PR unite (30g)
140

Descrizione

*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

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.