W3C home > Mailing lists > Public > www-validator@w3.org > April 2008

Re: please add Accept header to http request containing application/xhtml+xml

From: Etienne Miret <elimerl@gmail.com>
Date: Mon, 21 Apr 2008 20:47:30 +0200
Message-ID: <480CE142.8030502@gmail.com>
To: Alexandre Alapetite <alexandre@alapetite.net>
CC: Dean Edridge <dean@55.co.nz>, www-validator@w3.org

Hi Alexandre,

Alexandre Alapetite wrote:
> Internet Explorer (4, 5, 6, 7, 8) does send an Accept header, and it
> is not empty.
No, but according to the standard, the headers they send mean *exactly* 
the same thing as if they were not sending any Accept header. That is, 
they mean that IE accept any media-type, with none preferred over the 
others.

> Dean Edridge wrote:
>> IMHO it is not good practise for any web server to send XHTML
>> to a user-agent without first knowing that the user-agent accepts XHTML.
>> This may seem like an odd concept to some but it is just the way things are
>> if you want to use XHTML on the web today.
> 
> I am not aware of any user agent that does NOT send an Accept header
> at all, and to which it would be problematic to send
> application/xhtml+xml.
This is a rather special case. Instead of having a special case for IE, 
you have a special case for the few UA who send no Accept header at all, 
although it is suppose to mean the same thing as "Accept: */*".

> The following algorithm does not require any user agent sniffing, is
> not that dirty, and works with all user agents I have been able to put
> my hands on (including W3C validator):
Well, if I'm correct, Nikita The Spider sends an Accept header of "*/*", 
and with this algorithm, you would send it HTML although it is very able 
to handle XHTML.

> In PHP, it is possible to implement a full standard
> content negotiation mechanism, but it is not possible using a simple
> rewrite rule in a .htaccess.
If you do full standard content negotiation, you'll get random support 
for IE. Really random support, that's what I have on my website. Since 
IE pretends it likes XHTML as much as HTML, my server will sometime send 
HTML, and sometime send XHTML.

Regards,

-- 
Etienne Miret
Ne m'envoyez pas de fichier Word SVP, je ne peux pas les lire !
Don't send me Word attachments please, I can't read them!
http://perso.ens-lyon.fr/etienne.miret/Netiquette/no_MS_Office
Received on Monday, 21 April 2008 18:48:12 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 April 2012 12:14:29 GMT