Bug 28654 - [Qt] MIME handling in qtwebkit network layer case-sensitivity
Summary: [Qt] MIME handling in qtwebkit network layer case-sensitivity
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: QtWebKit Unassigned
URL: http://www.buienradar.nl/images.aspx?...
Keywords: Qt, QtTriaged
Depends on:
Blocks:
 
Reported: 2009-08-22 05:26 PDT by Richard Moore
Modified: 2012-01-10 11:26 PST (History)
12 users (show)

See Also:


Attachments
Patch to fix the bug (804 bytes, patch)
2009-08-22 05:26 PDT, Richard Moore
no flags Details | Formatted Diff | Diff
Patch (3.25 KB, patch)
2010-07-12 13:11 PDT, Robert Hogan
no flags Details | Formatted Diff | Diff

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