Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
davildaran opened this issue Feb 5, 2025 · 1 comment
Labels

Comments

@davildaran
Copy link

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 <http://...> 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

Using envoy v 1.1.x

@davildaran davildaran changed the title Unable to set or at least view http response headers Unable to set or at least view additional http response headers via ResponseHeaderModifier Feb 5, 2025
@zirain
Copy link
Member

zirain commented Feb 6, 2025

can you try with latest version, there're serval tests around ResponseHeaderModifier in conformance test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants