httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Covener <cove...@gmail.com>
Subject Re: Potential output filter order of processing
Date Tue, 17 Oct 2017 14:46:31 GMT
On Tue, Oct 17, 2017 at 9:59 AM, Nick Gearls <nickgearls@gmail.com> wrote:
> Hello,
>
> I encounter a problem with the order of processing of output filters.
> Maybe I'm missing some background but there's something very weird.
> I'll show the example with mod_substitute but I imagine it's similar for
> other modules (although I'm not sure).
>
> Case 1:
>    Subst "s/x/1x/qn"
>    Subst "s/x/2x/qn"
>    Result: 'x' is replaced by '12x' (seems logical)
>
> Case 2:
>    <Location />
>    Subst "s/x/1x/qn"
>    Subst "s/x/2x/qn"
>    </Location>
>    Result: 'x' is replaced by '12x' (seems logical)
>
> Case 3:
>    <Location />
>    Subst "s/x/1x/qn"
>    </Location>
>    <Location />
>    Subst "s/x/2x/qn"
>    </Location>
>    Result: 'x' is replaced by '21x' ?!?
>
> Apache is supposed to execute location from top to bottom, no? So why does
> it parse them the other way around in this case?
> The filter is defined as AP_FTYPE_RESOURCE; does this impact the order of
> processing locations?

Each module merges the config pairwise at config time, creating its
own data structures.
So if it's the wrong order, this would be in mod_substitute per_dir
config merge function.

Mime
View raw message