envoyproxy / envoyproxy/gateway

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

Abierto
#5,216 2 comentarios 0 reacciones 0 asignados Ver en GitHub
stale triage
Lenguaje dominante
Go
Estrellas
3k
Forks
864
Merge medio
2 d 2 h
PR fusionados (30 d)
140

Descripción

*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

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.