Summary: | Send a more specific Accept http header | ||
---|---|---|---|
Product: | [Unmaintained] kio | Reporter: | Jim Dabell <jim> |
Component: | http | Assignee: | Unassigned bugs mailing-list <unassigned-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | Christian.Hujer |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Jim Dabell
2003-01-08 03:00:13 UTC
I suggest giving application/xhtml+xml higher priority than text/xml and application/xml because the first one is more specific in any way than the latter ones. Also, video/x-mng should be preferred over png which itself should be preferred over jpeg. So I suggest to use: Accept: application/xhtml+xml,text/xml;q=0.9,application/xml;q=0.9,text/html;q=0.8,text/plain;q=0.7,video/x-mng,image/png;q=0.9,image/jpeg;q=0.8,image/gif;q=0.2,text/css,*/*;q=0.1 And as soon as Konqueror supports SVG, the Accept header should be: Accept: application/xhtml+xml,text/xml;q=0.9,application/xml;q=0.9,text/html;q=0.8,text/plain;q=0.7,image/svg+xml,video/x-mng;q=0.9,image/png;q=0.8,image/jpeg;q=0.7,image/gif;q=0.2,text/css,*/*;q=0.1 I would really not be anxious about the length as long as the header doesn't exceed an MTU (and it doesn't). Another relevant link: http://bugzilla.mozilla.org/show_bug.cgi?id=201195 I would *strongly* discourage putting application/xhtml+xml into the accept header. Last time I checked, konqueror just chucks xhtml documents through it's tag soup parser, which is not correct behaviour at all for xhtml served as application/xhtml+xml. For more details, please see bug #52665 mng, png and jpeg all serve different purposes - it doesn't make sense to prefer one over another. Where there is a specific reason for providing multiple image formats (I can't think of any off the top of my head), the author can weight the elements on the server-side - I don't see why konqueror should care which it gets. Konqueror should care about different image formats having different priorities because thus it can tell the server it supports and prefers e.g. image/mng over image/gif. The only chance for a server to easily do content negotiation is to listen to the priorities given client side. The default priorities on the server side must match the crappy */* several browsers shamelessly send without adding a low priority, so the server itself must prefer old crap like image/gif or image/jpeg over the new formats like image/svg+xml, image/png or video/x-mng. So if I have some little animation which is smaller in video/x-mng than in image/gif, I'd like to put it on the server as both formats, serving mng-supporting browsers with video/x-mng and image/gif to the others. If a user agent doesn't tell my server it prefers video/x-mng it won't get video/x-mng. This is totally analogeous to the HTML vs. XHTML issue. (Of course, Konqueror doesn't support XHTML properly yet?) /Christian Hello, Please read RFC 2616 section 14.1 to see how the Accept header works. Your description about how the preference for a specific mime-type works is simply wrong. If there is no quality factor specified the precedence is to prefer the more specific mime-types over the geneirc ones. For example, for Accept: text/html, image/jpeg, image/png, text/*, image/*, */* The precedence would be text/html image/jpeg image/png text/* image/* */* Now the server can substitute image/jpeg or image/png for text/html at will if that is the only mime-type it can send back. Anyways, I have fixed the default header so it now it does Accept: text/html, image/jpeg, image/png, text/*, image/*, */* instead of Accept: text/*, image/jpeg, image/png, image/*, */* BTW, we did start out sending the quality factor, but later removed it because it does not work with some webservers. IIRC, it was the older version of Netscape's webservers (Sun's iplanet now??) that choked on it. Regards, Dawit A. Hi Dawit, I know how Mime works, but Microsoft doesn't, which forces me to configure my servers not just accordingly to the Mime RFCs but also to Microsoft's "Accept: */*". /Christian |