406, what’s the point?

I modify my IE so as to send an Accept-Header clearly indicating that it doesn’t understand application/xhtml+xml. This seems wise as it doesn’t and most people will also offer up a non-XHTML representation of their content.

Terje Bless’s “homepage” only provides an XHTML representation, which rather annoyingly for me, Apache decides to send rather than a 406 response. This seemed odd, but it’s apparently completely fine: RFC 2616 section 10.4.7 says:

Note: HTTP/1.1 servers are allowed to return responses which are not acceptable according to the accept headers sent in the request. In some cases, this may even be preferable to sending a 406 response. User agents are encouraged to inspect the headers of an incoming response to determine if it is acceptable.

I don’t understand why some useless document is preferable to a 406 with a list of available representations (so I can choose a different UA), but apparently it is - it doesn’t seem to help the usefulness of HTTP ACCEPT headers though.

Comments

  1. Anonymous Says:

    I agree. http://issues.apache.org/bugzilla/show_bug.cgi?id=17936