bug leads to representation compromise

2007-11-25 @ 11:59#

as i work through an acceptable implementation of "multiple representations" for the same resource, i've come up against a bug in my library that supports XInclude. while the spec allows for the inclusion of an accept attribute, the library i am using fails to honor this when yo are using a request that is authenticated [sigh]. since much of my exyus engine uses HTTPAuth, this renders the accept and the accept-language attributes unavailable to me.

so i came up with a compromise. now, you can pass a querystring argument that will 'override' the Accept header - ?_accept=text/xml. it's not ideal, but it works fine. it has the added benefit of allowing me to easily change representations using a common browser. i have more than the Accept header available to me now!

btw - i could also implement "extension sniffing" for document ids. in other words, use the file extension as a way to override the Accept header. however, i think this will get in the way in some cases. in other words, i do not want to *force* the use of file extensions in order to solve this bug. my solution makes for some messier URLs in some limited cases (XInclude and using a simple browser), but maintains the proper implementation support for all other cases (using the Accept header for WWW libraries, Ajax, etc.)

code