S
SteW said:*should not*
Toby said:SteW wrote:
"should not" ~ "may".
Bertilo said:That code is not good. You should take the "q" values into consideration.
Toby said:Bertilo Wennergren wrote:
Most of the sample code I have seen for parsing the q value on the web has
been crap and usually interprets q=0.9 as q=0.
If you know of a regular expression that will interpret the q value
correctly[2], please let me know as I'd like to use it.
Bertilo said:I once published a demo of my own PHP routines to this. You can have a
look at it here (I hope it's not crap):
<URL:http://groups.google.com/[email protected]&oe=UTF-8&output=gplain>
Toby said:Bertilo Wennergren wrote:
That is indeed better than most I have seen, but still not perfect.
Consider:
Accept: application/xhtml+xml;charset=utf-8;q=1, */*;q=0.1
Bertilo said:Oh dear... I had no idea "charset=..." could jump in there and upset the
apple cart. Should be easy to add in that eventuality though. But is
there yet more stuff that can appear there?
Toby said:Bertilo Wennergren wrote:
Any registered Content-Type parameter -- as far as any MIME type related
to XHTML is concerned this is limited only to charset.
XHTML 1.1 (as opposed to 1.0) should be served as
application/xhtml+xml rather than text/html
Agreed.
and IE doesn't know what
to do with that content-type.
Agreed.
As most of the WWW uses IE that means
that XHTML 1.1 isn't suitable for the WWW.
Unless you content-negotiate. Give XHTML to the XHTML browsers, and
let the rest eat HTML.
Jukka K. Korpela said:OK, so what do you give to a user agent that sends the following?
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
application/vnd.ms-powerpoint, application/vnd.ms-excel,
application/msword, */*
The Accept header is where the client does its part of content negotiation.
There is no expressed preference between the two alternatives you are
interested in, but an expressed willingness to receive anything, so to be
logical, you should send the modern stuff, right?
Jukka said:OK, so what do you give to a user agent that sends the following?
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
application/vnd.ms-powerpoint, application/vnd.ms-excel,
application/msword, */*
OK, so what do you give to a user agent that sends the following?
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
application/vnd.ms-powerpoint, application/vnd.ms-excel,
application/msword, */*
The Accept header is where the client does its part of content
negotiation. There is no expressed preference between the two
alternatives you are interested in, but an expressed willingness
to receive anything, so to be logical, you should send the modern
stuff, right?
That is indeed better than most I have seen, but still not perfect.
Bertilo said:What do you say, Toby?
Feel free to [...] use it.
I very well might.Bertilo said:What do you say, Toby? Looks good to me.
Feel free to [...] use it.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.