-
Notifications
You must be signed in to change notification settings - Fork 849
Rewrite url after running all remap plugins #4531
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
Conversation
|
This has been a mess for a while, but I think this also needs to be discussed on the mailing list, to make sure we don't get surprises. |
|
OK. I will send mail about this problem to dev mailing list. |
|
[approve ci] |
|
My one concern was that |
|
|
||
| private: | ||
| unsigned int _cur = 0; | ||
| unsigned int _rewriten = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is minor, but could we name the member _rewritten with two ts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I missed that :)
| if (_rewriten == 0) { | ||
| Debug("url_rewrite", "plugin did not change host, port or path, copying from mapping rule"); | ||
| url_rewrite_remap_request(_s->url_map, _request_url, _s->hdr_info.client_request.method_get_wksidx()); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are moving and then duplicating this code. Should we pull this out into its own function or is it OK as-is?
|
I did not notice that this had been merged while I was reviewing it. |
Described at #2877
When we configure remap.config like the following snippet, the second remap plugin using
rri->requestUrlget post-remap url information from ATS.The cause of this behavior is ATS executes
url_rewrite_remap_requestfunction after running the first remap plugin.Therefore, behavior of a remap plugin as the first plugin is different from that as the second plugin.
I think ATS should execute all remap plugins and then rewrite url.