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])) {
?

Reply via email to