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

[Bug 18] For conneg, allow choosing the Accept-* headers to send.

From: <bugzilla@wiggum.w3.org>
Date: Fri, 28 Sep 2007 09:11:18 +0000
CC:
To: www-validator-cvs@w3.org
Message-Id: <E1IbBsU-0002UV-TD@wiggum.w3.org>

http://www.w3.org/Bugs/Public/show_bug.cgi?id=18





------- Comment #17 from dean@55.co.nz  2007-09-28 09:11 -------
> Dean, there is more to content-negotiation than the hack for IE and XHTML. :)
> 
> thanks
> olivier
> 
The only 'hack' in my content negotiation script is the line where I have to
unnecessarily check for your user-agent as it fails to give my server an accept
header.

if (stristr($_SERVER['HTTP_ACCEPT'], "application/xhtml+xml") ||

        /* the line below is an unnecessary hack :) */
        stristr($_SERVER["HTTP_USER_AGENT"], "W3C_Validator")) 
{
        $mime = "application/xhtml+xml";
}
else
{
        $mime = "text/html";
}
header("Content-Type: $mime; charset=utf-8");


Thanks
Dean 
Received on Friday, 28 September 2007 09:11:26 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 10 December 2014 20:08:28 UTC