W3C home > Mailing lists > Public > www-qa@w3.org > August 2005

Re: XHTML 1.0 Content-Negotiation

From: David Dorward <david@dorward.me.uk>
Date: Sat, 6 Aug 2005 21:39:07 +0100
To: www-qa@w3.org
Message-ID: <20050806203907.GE12730@us-lot.org>

On Sat, Aug 06, 2005 at 01:26:45PM -0700, James Pickering wrote:

>    if ( isset($_SERVER["HTTP_ACCEPT"]) and
>    stristr($_SERVER["HTTP_ACCEPT"],"application/xhtml+xml") ) {My
>    header("Content-type: application/xhtml+xml");

This is harmful, it just looks for the string "application/xhtml+xml",
so it would serve that content type to a browser with:

  Accept: text/html, application/xhtml+xml-1

Which is a somewhat nonsensical and theoretical content type (which is
not application/xhtml+xml). Of more practical and immediate
consequence is that it pays no attention to quality values:

  Accept: text/html, application/xhtml+xml;q=0

Would get served application/xhtml+xml despite explicitly stating that
XHTML is not accepted.



-- 
David Dorward                                      http://dorward.me.uk
Received on Saturday, 6 August 2005 20:39:22 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Sunday, 6 December 2009 12:14:01 GMT