W3C home > Mailing lists > Public > www-validator@w3.org > August 2007

Re: Validator doesn't send HTTP_ACCEPT headers, "Conflict between Mime Type and Document Type" warning is incorrect.

From: David Dorward <david@dorward.me.uk>
Date: Tue, 31 Jul 2007 23:29:21 +0100
Message-Id: <2EC154ED-1BDF-4473-B494-7E4630F8BF98@dorward.me.uk>
To: www-validator Community <www-validator@w3.org>

On 31 Jul 2007, at 14:24, Gez Lemon wrote:
> header("Vary: Accept");
> if (stristr($_SERVER[HTTP_ACCEPT], "application/xhtml+xml") === FALSE)
>     header("Content-Type: text/html; charset=utf-8");
> else
>     header("Content-Type: application/xhtml+xml; charset=utf-8");

Accept: text/html, application/xhtml+xml;q=0 would get an XHTML  
content type there.

Just looking for substrings is not a good way of parsing Accept headers.
-- 
David Dorward
http://dorward.me.uk/
http://blog.dorward.me.uk/
Received on Wednesday, 1 August 2007 08:07:35 GMT

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