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

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 UTC