You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@trafficserver.apache.org by Walt Karas <wk...@verizonmedia.com.INVALID> on 2020/11/13 18:54:01 UTC

Proposed changes to regex_remap core plugin

1.  Two-character string substitutions can begin with ^ as well as $.  If ^
is used, and the substitution is a URL component, the component will be the
one in the pristine, rather than the remapped, URL.  So, for example, $h is
the host in the remapped URL, and ^h is the host in the pristine URL.  (^
seems intuitive as "before URL" with $ as "after URL", because ^ means
start of line and $ means end of line in regular expressions.)

2. Add the string substitutions $$ (translating to $) and ^^ (translating
to ^).

Re: Proposed changes to regex_remap core plugin

Posted by Alan Carroll <so...@verizonmedia.com>.
+1

On Fri, Nov 20, 2020 at 1:47 PM Walt Karas <wk...@verizonmedia.com> wrote:

> I'm abandoning this, as it turns out it doesn't address our (Verizon)
> issue that I need to handle.  I had thought that regex_remap matched
> against the pristine URL.  But it matches against the requestURL passed to
> TSRemapDoRemap().  In ATS7, the pristine URL was passed to the first remap
> plugin, and we have ATS applications that rely on being able to match
> against the pristine URL.  So I'm going to add the pparams "remapped" and
> "pristine"'.  "remapped" will mean the current behavior (which will also be
> the default behavior if "pristine" is not used).  "pristine" will mean the
> pristine URL is used in place of the remapped, for matching as well as
> substitution.
>
> On Fri, Nov 13, 2020 at 12:54 PM Walt Karas <wk...@verizonmedia.com>
> wrote:
>
>> 1.  Two-character string substitutions can begin with ^ as well as $.  If
>> ^ is used, and the substitution is a URL component, the component will be
>> the one in the pristine, rather than the remapped, URL.  So, for example,
>> $h is the host in the remapped URL, and ^h is the host in the pristine
>> URL.  (^ seems intuitive as "before URL" with $ as "after URL", because ^
>> means start of line and $ means end of line in regular expressions.)
>>
>> 2. Add the string substitutions $$ (translating to $) and ^^ (translating
>> to ^).
>>
>

Re: Proposed changes to regex_remap core plugin

Posted by Walt Karas <wk...@verizonmedia.com>.
I'm abandoning this, as it turns out it doesn't address our (Verizon) issue
that I need to handle.  I had thought that regex_remap matched against the
pristine URL.  But it matches against the requestURL passed to
TSRemapDoRemap().  In ATS7, the pristine URL was passed to the first remap
plugin, and we have ATS applications that rely on being able to match
against the pristine URL.  So I'm going to add the pparams "remapped" and
"pristine"'.  "remapped" will mean the current behavior (which will also be
the default behavior if "pristine" is not used).  "pristine" will mean the
pristine URL is used in place of the remapped, for matching as well as
substitution.

On Fri, Nov 13, 2020 at 12:54 PM Walt Karas <wk...@verizonmedia.com> wrote:

> 1.  Two-character string substitutions can begin with ^ as well as $.  If
> ^ is used, and the substitution is a URL component, the component will be
> the one in the pristine, rather than the remapped, URL.  So, for example,
> $h is the host in the remapped URL, and ^h is the host in the pristine
> URL.  (^ seems intuitive as "before URL" with $ as "after URL", because ^
> means start of line and $ means end of line in regular expressions.)
>
> 2. Add the string substitutions $$ (translating to $) and ^^ (translating
> to ^).
>

Re: Proposed changes to regex_remap core plugin

Posted by Walt Karas <wk...@verizonmedia.com.INVALID>.
I'm abandoning this, as it turns out it doesn't address our (Verizon) issue
that I need to handle.  I had thought that regex_remap matched against the
pristine URL.  But it matches against the requestURL passed to
TSRemapDoRemap().  In ATS7, the pristine URL was passed to the first remap
plugin, and we have ATS applications that rely on being able to match
against the pristine URL.  So I'm going to add the pparams "remapped" and
"pristine"'.  "remapped" will mean the current behavior (which will also be
the default behavior if "pristine" is not used).  "pristine" will mean the
pristine URL is used in place of the remapped, for matching as well as
substitution.

On Fri, Nov 13, 2020 at 12:54 PM Walt Karas <wk...@verizonmedia.com> wrote:

> 1.  Two-character string substitutions can begin with ^ as well as $.  If
> ^ is used, and the substitution is a URL component, the component will be
> the one in the pristine, rather than the remapped, URL.  So, for example,
> $h is the host in the remapped URL, and ^h is the host in the pristine
> URL.  (^ seems intuitive as "before URL" with $ as "after URL", because ^
> means start of line and $ means end of line in regular expressions.)
>
> 2. Add the string substitutions $$ (translating to $) and ^^ (translating
> to ^).
>