contour
contour copied to clipboard
Support setting response headers for DirectResponsePolicy Routes
I noticed that when I was trying to use a directResponsePolicy in a route, the responseHeadersPolicy would not actually take effect:
routes:
- conditions:
- exact: /foo
directResponsePolicy:
statusCode: 200
responseHeadersPolicy:
set:
- name: "Header-To-Add"
value: "val"
$ curl -v https://example.site.com/foo
> GET /foo HTTP/2
> Host: example.site.com
> user-agent: curl/7.81.0
> accept: */*
...
< HTTP/2 200
< vary: Accept-Encoding
< date: Tue, 20 Feb 2024 23:43:58 GMT
< server: envoy
According to the Envoy docs, Direct Responses will include any headers specified in response_headers_to_add.
Perhaps this is a feature not yet added to Contour as response_headers_to_add is not populated in the case of a DirectResponse:
https://github.com/projectcontour/contour/blob/94e591fc8fab76c74a83d367b03e256062834ca5/internal/envoy/v3/route.go#L124-L125
Hey @flawedmatrix! Thanks for opening your first issue. We appreciate your contribution and welcome you to our community! We are glad to have you here and to have your input on Contour. You can also join us on our mailing list and in our channel in the Kubernetes Slack Workspace
The Contour project currently lacks enough contributors to adequately respond to all Issues.
This bot triages Issues according to the following rules:
- After 60d of inactivity, lifecycle/stale is applied
- After 30d of inactivity since lifecycle/stale was applied, the Issue is closed
You can:
- Mark this Issue as fresh by commenting
- Close this Issue
- Offer to help out with triage
Please send feedback to the #contour channel in the Kubernetes Slack
The Contour project currently lacks enough contributors to adequately respond to all Issues.
This bot triages Issues according to the following rules:
- After 60d of inactivity, lifecycle/stale is applied
- After 30d of inactivity since lifecycle/stale was applied, the Issue is closed
You can:
- Mark this Issue as fresh by commenting
- Close this Issue
- Offer to help out with triage
Please send feedback to the #contour channel in the Kubernetes Slack
The Contour project currently lacks enough contributors to adequately respond to all Issues.
This bot triages Issues according to the following rules:
- After 60d of inactivity, lifecycle/stale is applied
- After 30d of inactivity since lifecycle/stale was applied, the Issue is closed
You can:
- Mark this Issue as fresh by commenting
- Close this Issue
- Offer to help out with triage
Please send feedback to the #contour channel in the Kubernetes Slack