Open shivanshu21 opened 4 years ago
Tried posting this in Slack too. No response.
How about we introduce a new route action called 3xx_location_rewrite
here:
https://github.com/envoyproxy/envoy/blob/master/api/envoy/config/route/v3/route_components.proto#L837
And implement this over here:
Filter::onUpstreamHeaders()
https://github.com/envoyproxy/envoy/blob/master/source/common/router/router.cc#L1295
Based on whether response_code
is 3xx (or more specifically 301/302).
@mattklein123 @htuch ?
cc @alyssawilk any thoughts on ^?
I think it's reasonable, especially if we can use the same API and libraries that we use for rewrites on the request URL.
Is there anything which might vary based for location headers based on incoming requests such that we'd want to perform the rewrite for cache responses as well? I'd hope not, but ynk.
@mattklein123 @alyssawilk Should we convert this from question to an issue? I will raise a PR this week for adding this.
SGTM, thanks. I'll assign it your way!
@shivanshu21 this is great work! I'm concerned that if it's only specific to location headers, could this not be more generalized for any HTTP header by just specifying 1) the header to modify (ie - Location) 2) Regex specifying what needs to be replaced and with what.
What are your thoughts? thanks!
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 other activity occurs. Thank you for your contributions.
Any updates on whether this is coming?
The PR was halted for Unified match predicates to be implemented.
This issue got expanded into a generalized header rewrite use case. Let me check if the unified match predicate work is done then I can rebase.
Title:
Description: We use an encode filter to rewrite location URL today in eBay traffic engineering, but this looks like a feature that should be supported from upstream Envoy side.
We are using Envoy 1.13. Is this feature already available in master? Is it required upstream?
What we are looking for is: