internal redirects: support passing headers from response to request (#30793)
* internal redirects: Support passing headers from response to request This adds a new (repeated) field in the internal redirect policy, "response_headers_to_preserve". When set, the headers named there will be copied from the response that triggers an internal redirect into the request that follows. This allows some limited information passing through the internal redirect system. The current system is faithful to the idea that internal redirects are purely a latency optimization, and should behave similarly to if the redirect had been passed to the downstream user-agent. This does violate that idea. Other proxies, such as Nginx, have a much more flexible way of handling internal redirects that allows a fair bit of information passing like this. This should allow implementations to adopt Envoy that are using this kind of information passing, with reduced needs to rearchitect. Fixes: #30441 Fixes: #16777 Signed-off-by: Ryan Anderson <ryan.anderson@snowflake.com> Signed-off-by: Ryan Anderson <ryan@michonline.com> * Switching loops to references Signed-off-by: Ryan Anderson <ryan@michonline.com> * Clarify that downstream filters will not run Signed-off-by: Ryan Anderson <ryan@michonline.com> * Use a vector of LowerCaseStrings Signed-off-by: Ryan Anderson <ryan@michonline.com> * Format fixes Signed-off-by: Ryan Anderson <ryan@michonline.com> * Fully qualify 'downstream_' Signed-off-by: Ryan Anderson <ryan@michonline.com> * Rename from ..._to_preserve to ..._to_copy Signed-off-by: Ryan Anderson <ryan@michonline.com> * Reject configs that specify HTTP/2 style headers or Host Signed-off-by: Ryan Anderson <ryan@michonline.com> * Fight with clang-tidy by hand Signed-off-by: Ryan Anderson <ryan@michonline.com> * Fixup bad doc references Signed-off-by: Ryan Anderson <ryan@michonline.com> * punctuation Signed-off-by: Ryan Anderson <ryan@michonline.com> * More doc fixups Signed-off-by: Ryan Anderson <ryan@michonline.com> * Add a small comment about request_headers_to_copy_ Signed-off-by: Ryan Anderson <ryan@michonline.com> * Rip out the complicated header copying/restore logic and replace This removes the existing specialized save/restore logic in favor of just copying every header into another map, updating the original map with the necessary changes, and then restoring the whole thing later on. Signed-off-by: Ryan Anderson <ryan@michonline.com> * Use copyFrom() instead of doing it by hand Signed-off-by: Ryan Anderson <ryan@michonline.com> * Return a reference instead of copying Signed-off-by: Ryan Anderson <ryan@michonline.com> * Deauto things Signed-off-by: Ryan Anderson <ryan@michonline.com> * fight with clang-format Signed-off-by: Ryan Anderson <ryan@michonline.com> * Just use copyFrom() Signed-off-by: Ryan Anderson <ryan@michonline.com> --------- Signed-off-by: Ryan Anderson <ryan.anderson@snowflake.com> Signed-off-by: Ryan Anderson <ryan@michonline.com> Mirrored from https://github.com/envoyproxy/envoy @ 65bbace5fb0647ac6edc338c62cfc8fc69fda36emain
parent
3ca196f8dc
commit
9e1c1c56ce
1 changed files with 9 additions and 0 deletions
Loading…
Reference in new issue