On Sat, Dec 19, 2020 at 11:02 PM Nick Kew <n...@apache.org> wrote:
>
> On Thu, 17 Dec 2020 17:31:20 +0000
> Nick Kew <n...@apache.org> wrote:
>
> > > On 17 Dec 2020, at 16:22, Joe Orton <jor...@redhat.com> wrote:
> >  [chop]
> > Thanks for prompting me to take a proper look at where this thread
> > started.
>
> Further thought: anything hardwired will come up against future
> use cases where it acts contrary to expectations and indeed
> requirements.  A future-proof solution is to make it configurable.
>
> I attach a patch I've just hacked (untested): if folks are happy
> with the approach I'll flesh it out and commit.

Looks good to me.

I still wonder if the default (when no xml2MimeType is configured)
shouldn't be something like:

        if (!ctx->checkedmime) {
            if (strncmp(ctype, "text/html", 9)
                && (!(x = strstr(ctype, "xml"))
                    || (x > ctype && apr_isalnum(x[-1])
                    || apr_isalnum(x[3]))))  {
                ap_remove_output_filter(f);
                return ap_pass_brigade(f->next, bb) ;
            }
            ctx->checkedmime = 1;
        }

so that we still include "text/html" and anything "xml" but not in the
middle of a word like the problematic
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
from PR 64339 (or github #150).
Or are there some real middle-word "xml" mime types which we want to handle?

Regards;
Yann.

Reply via email to