Sorry I went quiet on this - I got a bit tied up with other stuff.
I've installed the latest version of webob, from github, and it
doesn't fix either problem. I've also been playing with a local copy.
I've worked out a fix for the case sensitive matching of MIME types -
simply adding .lower() at the appropriate places in MIMEAccept._match
(similar to what Accept._match does)
The whole selection of the best match by q-value seems to be subverted
by the calling environment. As far as I can tell the logic within
Accept.best_match is working just fine, but for a single HTTP request,
I'm seeing the Accept object constructed 4 times, and best_match
called three times, with different "offer" lists. As far as I can
tell, the final instantiation of Accept doesn't call best_match at
all, and that's what's returned to the caller:
**** Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/
*;q=0.8,application/rdf+xml;q=0.93,text/rdf+n3;q=0.5
**** best_match ['application/rdf+xml', 'text/turtle', 'text/html']
:
**** Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/
*;q=0.8,application/rdf+xml;q=0.93,text/rdf+n3;q=0.5
**** best_match ['application/rdf+xml', 'text/turtle']
:
**** Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/
*;q=0.8,application/rdf+xml;q=0.93,text/rdf+n3;q=0.5
**** best_match ['text/turtle']
**** Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/
*;q=0.8,application/rdf+xml;q=0.93,text/rdf+n3;q=0.5
So it seems that the Pyramid request routing logic is making multiple
calls with a reducing list of possible server offers for handling the
MIME type.
#g
> signature.asc
> < 1KViewDownload