Bug 33242 - Does not send an Accept header for subresources, causing some sites to break
Summary: Does not send an Accept header for subresources, causing some sites to break
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Linux
: P2 Normal
Assignee: Gustavo Noronha (kov)
URL: http://www.inkscapegallery.net/quicks...
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-05 17:20 PST by Gustavo Noronha (kov)
Modified: 2010-02-18 00:18 PST (History)
5 users (show)

See Also:


Attachments
Send Accept: image/* when obtaining image resources (5.42 KB, patch)
2010-02-16 05:51 PST, Gustavo Noronha (kov)
beidson: review-
gustavo: commit-queue-
Details | Formatted Diff | Diff
Make soup backend always send a "valid" Accept header, when one is not explicitly set (6.56 KB, patch)
2010-02-16 13:58 PST, Gustavo Noronha (kov)
xan.lopez: review+
gustavo: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gustavo Noronha (kov) 2010-01-05 17:20:19 PST
Initially reported in Debian (see http://bgus.debian.org/563736). WebKitGTK+ is unable to display the PNGs used in this site: http://www.inkscapegallery.net/quickstart. I tracked this to be working when the request is done using HTTP/1.0, and when it is done with HTTP/1.1 and with an Accept header. That is why it works if you copy the image address and open it - WebCore sends a default Accept header for main resources.

Safari seems to send an Accept header; Chromium sends Accept: */*, and works. Firefox sends a more specific header saying it prefers image/png, but accepts any image/* type. I guess it decided that because the resource is being loaded from an <img> tag.
Comment 1 Gustavo Noronha (kov) 2010-02-16 05:51:25 PST
Created attachment 48812 [details]
Send Accept: image/* when obtaining image resources
Comment 2 Brady Eidson 2010-02-16 13:17:24 PST
Comment on attachment 48812 [details]
Send Accept: image/* when obtaining image resources

r- 

Mucking with Accept headers is a notoriously dangerous thing to do.  

Safari and Chrome send out "valid" accept headers here that they've found to work for them.  WebKitGtk+ alone has the problem, so the fix needs to be targeted there.
Comment 3 Gustavo Noronha (kov) 2010-02-16 13:58:38 PST
Created attachment 48827 [details]
Make soup backend always send a "valid" Accept header, when one is not explicitly set

Given beidson's comments, I made the change local to our network backend. I tried putting the test in platform/gtk, but it seems like the special-casing of the http tests makes this difficult. If it turns out we need more exceptions like this, I'll take a look at fixing the special casing.
Comment 4 Xan Lopez 2010-02-17 06:20:42 PST
Comment on attachment 48827 [details]
Make soup backend always send a "valid" Accept header, when one is not explicitly set

If Chromium is doing the same thing then I guess it's a reasonable thing to do for compatibility.
Comment 5 Gustavo Noronha (kov) 2010-02-17 06:30:21 PST
Thanks! Landed as r54892.
Comment 6 Tony Chang 2010-02-18 00:17:41 PST
Committed r54941: <http://trac.webkit.org/changeset/54941>
Comment 7 Tony Chang 2010-02-18 00:18:24 PST
(In reply to comment #6)
> Committed r54941: <http://trac.webkit.org/changeset/54941>

Err, ignore this.  I think webkit-patch got confused.