We had a discussion on the IRC about this and we agree that treating the first 
plugin special is not a good idea and is confusing.  I looked at the code and 
approved the PR.  I would like to get someone else to look at it too before 
merging it, since it is an important change to the code.

Thank you for the PR!

-Bryan



> On Nov 4, 2018, at 7:06 PM, Takuya Kitano <tkit...@yahoo-corp.jp> wrote:
> 
> Hi,
> 
> I’d like to propose a change about the timing that ATS runs remap plugins.
> 
> Currently, we configure remap.config like the following snippet,
> and each plugins use `rri->requestUrl`,
> the behavior of a remap plugin as the first plugin is different from that as 
> the second plugin.
> 
> ```
> map http://before-remap.com/ http://after-remap.com/ @plugin=<first 
> plugin>.so @pparam=... @plugin=<second plugin>.so @pparam=...
> ```
> 
> In detail, the first plugin get pre-remapped url information from 
> `rri->requestUrl`,
> but the second plugin get post-remapped one.
> 
> The cause of this behavior is ATS executes `url_rewrite_remap_request` 
> function after running the first remap plugin.
> 
> My proposal is that ATS should execute all remap plugins and then rewrite url.
> 
> More ditails are in
> - Issue : https://github.com/apache/trafficserver/issues/2877
> - Pull Request : https://github.com/apache/trafficserver/pull/4531
> 
> 
> What do you think about this?
> 
> Thank you.
> 

Reply via email to