Bug 115501 - ResourceResponse might let non-lower-cased MIME types into WebCore
Summary: ResourceResponse might let non-lower-cased MIME types into WebCore
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-01 17:38 PDT by Tim Horton
Modified: 2013-05-02 09:21 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.