Bug 28654

Summary: [Qt] MIME handling in qtwebkit network layer case-sensitivity
Product: WebKit Reporter: Richard Moore <rich>
Component: Page LoadingAssignee: QtWebKit Unassigned <webkit-qt-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, commit-queue, eric, hausmann, jesus, kent.hansen, laszlo.gombos, luiz, markus, robert, tonikitoo, webkit.review.bot
Priority: P2 Keywords: Qt, QtTriaged
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
URL: http://www.buienradar.nl/images.aspx?jaar=-3&bliksem=0&voor=&soort=verwachting1x1
Attachments:
Description Flags
Patch to fix the bug
none
Patch none

Description Richard Moore 2009-08-22 05:26:51 PDT
Created attachment 38432 [details]
Patch to fix the bug

The code in webkit assumes MIME types will be lower case, but QNetworkAccessManager returns the mime type exactly as it is sent by the remote server. The RFC says mime types are case-insensitive, so in the case of the URL above which sends image/GIF things should work just fine. Unfortunately that is not the case, qtwebkit believes this mime type to be unsupported wheras image/gif is fine. The fix is simply to lowercase the mimetype as it is passed from QNAM to webkit.
Comment 1 Simon Hausmann 2009-11-23 05:56:26 PST
Richard, your patch needs a ChangeLog and a testcase/unit-test, and the patch should probably be marked for review :)
Comment 2 Richard Moore 2009-11-23 12:42:10 PST
Yeah, the difficulty here is that in order to avoid the test case
being more complex than the issue itself we need a server. I was
hoping that the server used by the QNAM performance tests would be
available for testing qtwebkit stuff but that never happened. This
leaves me with the webkit layout test server which i'm told supports
php so should be doable. I don't have that setup right now, so this is
waiting until I or someone else gets it setup and can write the test.
Comment 3 Simon Hausmann 2010-03-08 04:28:48 PST
One way of testing it is through a synthetic QNetworkAccessManager instance, like it's done in some of the unit tests, returning a fake http response.
Comment 4 Markus Goetz 2010-05-14 02:02:40 PDT
Check out tst_qnetworkreply the MiniHttpServer. You don't need a custom QNAM.
Comment 5 Robert Hogan 2010-07-12 13:11:58 PDT
Created attachment 61258 [details]
Patch
Comment 6 Simon Hausmann 2010-07-12 13:34:41 PDT
Comment on attachment 61258 [details]
Patch

Excellent, thanks Robert!

r=me. I hope it'll work with the other ports :)
Comment 7 WebKit Commit Bot 2010-07-13 11:56:52 PDT
Comment on attachment 61258 [details]
Patch

Clearing flags on attachment: 61258

Committed r63229: <http://trac.webkit.org/changeset/63229>
Comment 8 WebKit Commit Bot 2010-07-13 11:56:57 PDT
All reviewed patches have been landed.  Closing bug.
Comment 9 WebKit Review Bot 2010-07-13 12:17:28 PDT
http://trac.webkit.org/changeset/63229 might have broken GTK Linux 32-bit Release
The following changes are on the blame list:
http://trac.webkit.org/changeset/63228
http://trac.webkit.org/changeset/63229