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

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

From: David Dorward <david@dorward.me.uk>
Date: Fri, 18 Apr 2008 23:19:46 +0100
Message-Id: <BC6EF212-5789-4EDD-9180-52973D32F448@dorward.me.uk>
To: www-validator@w3.org, Noa Resare <noa@resare.com>

On 18 Apr 2008, at 08:58, Noa Resare wrote:
> In other words, adding "Accept: application/xhtml+xml, */*" to the  
> requests of the validator would be a nice thing.

If wouldn't actually help anything though.

If you are doing content negotiation and then sending exactly the same  
content, but with different Content-Types, then the validator is going  
to get the same data either way - so it makes no difference (and the  
content negotiation is pretty pointless).

If you do serve up different content, then it makes sense to be able  
to validate both versions, in which case you'll need to use some other  
strategy so that you can serve up both to the validator under  
different circumstances.

That said: http://www.w3.org/Bugs/Public/show_bug.cgi?id=112

> My rewrite rules:
> RewriteEngine on
> RewriteCond %{HTTP_ACCEPT} !application/xhtml\+xml
> RewriteCond %{REQUEST_URI} \.xhtml$
> RewriteRule .* - [T=text/html]

This will serve up application/xhtml+xml if the browser sends Accept:  
application/xhtml+xml;q=0, text/html (i.e. explicitly rejecting  
XHTML). You should get a better algorithm.

David Dorward
Received on Friday, 18 April 2008 22:20:25 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:59:07 UTC