> On 16 Dec 2020, at 17:47, Yann Ylavic <ylavic....@gmail.com> wrote:
> 
> On Wed, Dec 16, 2020 at 6:36 PM Yann Ylavic <ylavic....@gmail.com> wrote:
>> 
>> On Wed, Dec 16, 2020 at 5:23 PM <jor...@apache.org> wrote:
>>> 
>>> -    /* only act if starts-with "text/" or contains "xml" */
>>> -    if (strncmp(ctype, "text/", 5) && !strstr(ctype, "xml"))  {
>>> +    /* only act if starts-with "text/" or contains "+xml" */
>>> +    if (strncmp(ctype, "text/", 5) && !strstr(ctype, "+xml"))  {
>>>         ap_remove_output_filter(f);
>>>         return ap_pass_brigade(f->next, bb) ;
>>>     }
>> 
>> Wouldn't this stop matching "application/xml" for instance?
>> 
>> Possibly this test instead:
>>    if (strncmp(ctype, "text/", 5)
>>        && (!(x = strstr(ctype, "xml"))
>>            || x == ctype || !strchr("/+", x[-1]))) {
>> ?
> 
> I would even remove the "text/" check (why act on "text/plain" for
> instance), so maybe:
>    if (!(x = strstr(ctype, "xml"))
>            || x == ctype || !strchr("/+", x[-1])
>            || apr_isalnum(x[3])) {
> ?

Be liberal in what you accept.  You can limit it further in configuration,
but you can't override a hardwired check.

It certainly needs to operate on text/html for mod_proxy_html, and users might
find reasons for running it on other text types as an alternative to an iconv
filter like mod_charset(_lite).

-- 
Nick Kew

Reply via email to