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

Need 3XX Location URL rewrite feature #12591

Open
shivanshu21 opened this issue Aug 11, 2020 · 11 comments
Open

Need 3XX Location URL rewrite feature #12591

shivanshu21 opened this issue Aug 11, 2020 · 11 comments
Assignees
Labels

Comments

@shivanshu21
Copy link

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:

  1. Upstream sends some location header and 302.
  2. Envoy has an option for the route where it can rewrite the location header to a different value.
@shivanshu21
Copy link
Author

#10259

@mattklein123 mattklein123 added the question Questions that are neither investigations, bugs, nor enhancements label Aug 11, 2020
@shivanshu21
Copy link
Author

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 ?

@mattklein123
Copy link
Member

cc @alyssawilk any thoughts on ^?

@alyssawilk
Copy link
Contributor

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.

@shivanshu21
Copy link
Author

@mattklein123 @alyssawilk Should we convert this from question to an issue? I will raise a PR this week for adding this.

@alyssawilk alyssawilk added enhancement Feature requests. Not bugs or questions. and removed question Questions that are neither investigations, bugs, nor enhancements labels Aug 20, 2020
@alyssawilk
Copy link
Contributor

SGTM, thanks. I'll assign it your way!

@ccravens
Copy link

ccravens commented Sep 3, 2020

@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!

@stale
Copy link

stale bot commented Oct 4, 2020

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.

@stale stale bot added the stale stalebot believes this issue/PR has not been touched recently label Oct 4, 2020
@mattklein123 mattklein123 removed the stale stalebot believes this issue/PR has not been touched recently label Dec 9, 2020
@ToniCipriani
Copy link

Any updates on whether this is coming?

@mattklein123 mattklein123 added area/http help wanted Needs help! and removed enhancement Feature requests. Not bugs or questions. labels Dec 16, 2020
@shivanshu21
Copy link
Author

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.

#12938

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

Successfully merging a pull request may close this issue.

6 participants