> On Feb 12, 2016, at 5:33 AM, Konstantin Tokarev <annu...@yandex.ru> wrote:
> 
> In WebProcess/WebPage/WebPage.cpp MIMETypeRegistry::canShowMIMEType seems to 
> be called with argument of unknown case (the same string is then looked up in 
> ASCIICaseInsensitiveHash).
> 
> However, MIMETypeRegistry::canShowMIMEType does a case-sensitive 
> startsWith("text/").
> 
> Should MIMETypeRegistry::canShowMIMEType use startsWithIgnoringASCIICase 
> instead?

Yes.

It’s likely I introduced this problem recently. I changed the semantics of all 
MIMETypeRegistry functions to work with unknown case. It seems that I missed 
this one check.

Better test coverage would help here, too; I probably didn’t write enough tests 
and it would be helpful if we wrote some more. That requires a little research 
into how these functions are used so we can make tests that show the actual 
behavior, which I think would be more useful than unit tests of 
MIMETypeRegistry itself.

— Darin
_______________________________________________
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev

Reply via email to