envoy
envoy copied to clipboard
Allow to use `body_format` in direct_response
I would like to request that format strings (config.core.v3.SubstitutionFormatString) be supported inside a direct_response action for the router.
Right now it is only possible to provide hardcoded constant strings (from various sources) as the body for a direct_response action. However, it would be nice to be able to compose a response body from metadata provided by previous filters for example.
The custom_response filter already supports this using the localResponsePolicy but it requires to add another filter to the filter chain which does not easily give the same granularity of being invoked only for certain routes.
Makes sense to me. I would add that custom_response filter operates on the upstream responses, and I think you want to skip sending to the upstream altogether.
Yes definitely.
@ldb Contributions are welcome! You would need to extend the API for direct_response to accept a substitution format string, and then implement the logic. All the building blocks are there, so it's mostly getting it all wired in and tests.
This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions.
This issue has been automatically closed because it has not had activity in the last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted" or "no stalebot". Thank you for your contributions.
@kyessenov @mattklein123, is there interest in this this being re-opened? I would like to contribute this change and it's my motivation to learn C++ and dive deeper into envoy.