Bug 115501

Summary: ResourceResponse might let non-lower-cased MIME types into WebCore
Product: WebKit Reporter: Tim Horton <thorton>
Component: Page LoadingAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: ap, darin
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   

Description Tim Horton 2013-05-01 17:38:56 PDT
I don't see any code that ensures that the MIME type which ResourceResponseMac's ResourceResponse::platformLazyInit extracts from NSURLResponse (via -MIMEType) is lower-cased, but much of WebCore depends on MIME types being lower-cased.

It seems like it would be ideal to fix this in a cross-platform way, somewhere above ResourceResponse::platformLazyInit (maybe ResourceResponseBase::lazyInit, I don't know... and also in ResourceResponseBase::setMimeType).
Comment 1 Alexey Proskuryakov 2013-05-01 22:05:39 PDT
I am not sure if it's ResourceResponse responsibility to change what is sent by the server. For example, we should probably report the actual type in Web Inspector, which would be impossible if we lowercased the type here.
Comment 2 Darin Adler 2013-05-02 09:21:52 PDT
It’s too bad, since ResourceResponse is a convenient bottleneck. Worth thinking through where else it would be practical to do the case insensitivity or canonicalization.