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

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


stian+w3c@oksavik.no changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |stian+w3c@oksavik.no




------- Comment #18 from stian+w3c@oksavik.no  2008-01-06 18:11 -------
It seems to me the W3C is promoting a double standard here, ignoring HTTP while
demanding strict compliance with HTML/XHTML.

My pages, which are written in XHTML 1.1, now do the following:

If the HTTP_ACCEPT header indicates acceptance of application/xhtml+xml, I
serve the page as XHTML 1.1.

If the HTTP_ACCEPT header indicates acceptance of text/html (but not
application/xhtml+xml), I deliberately choose to violate spec by serving it as
text/html. This is a workaround to allow the content to be displayed by broken
browsers; however, I make users very aware of this by printing a warning that
their user agent does not support XHTML and some content may not render
properly.

If the HTTP_ACCEPT header contains neither of these, I return a 406 HTTP error.
This seems the correct thing to do, since these user agents are demanding
content in a form that my web server is unable to offer. In fact, although I'd
have to go read the HTTP spec to confirm, it seems to me that by sending a
blank (but present) HTTP_ACCEPT header, the W3C validator is stating that it
will not accept *any* content, regardless of format.

Yes, the root cause here is IE (and lynx, and a few older browsers, but
primarily IE) not support XHTML. Yes, I've complained to Microsoft. Microsoft
states that they'd rather not support it at all than add half-ass support by
treating XHTML as tag soup. While I commend them for THAT, I fail to understand
why a company with Microsoft's resources can't come up with an XHTML parser in
the span of half a decade.

But the fact that IE lacks support for XHTML is no excuse for the W3C to fail
to validate my valid XHTML. The fact that I choose to serve SOME content to
browsers such as IE *with* a warning should be irrelevant to the W3C, since the
W3C validator is supposed to validate XHTML and therefore has no excuse to lie
to the browser about supporting it in the first place.

I guess people attempting to validate my sites will have to live with the 406
for now. This is the best way I can see to comply with HTTP content negotiation
rules without adding a special case for the W3C; adding exceptional handling
for a standards body is something I refuse to do.

Received on Sunday, 6 January 2008 18:11:58 UTC