[Zope] Hard-coded "Content-type:text/xml" as xmlrpc in Zope (2.8.1)

John Ziniti jziniti at speakeasy.org
Mon Nov 21 15:04:40 EST 2005


Back in June 2004, I had the following problem:

http://mail.zope.org/pipermail/zope/2004-June/151436.html
http://mail.zope.org/pipermail/zope/2004-June/151492.html
http://mail.zope.org/pipermail/zope/2004-June/151497.html
http://mail.zope.org/pipermail/zope/2004-June/151498.html

which came about because HTTPRequest.py was hard-coded
to assume that any request with a Content-type of "text/xml"
is an xmplrpc call and handles the request as such.

I resolved this issue with the help of brian at zope.org, who
gave me the XmlFix product, which monkey-patches the
HTTPRequest.processInputs method to respond a bit more
appropriately.  We noted in the thread that although Zope's
behavior is broken, it is unlikely to change for
historical reasons.  I am fine with this and felt comfortable
with the simplicity and supportability of the monkey-patch.

This monkey-patch was no longer effective recently when I
upgraded our Zope instances to 2.8.1.

Zope-2.8.1 now additionally has the zope.app.publication.
HTTPPublicationRequestFactory class, which also assumes
that "text/xml" means xmlrpc (in fact, it assumes that
anything that startswith('text/xml') is an xmlrpc call).

Not fixing old code which acts in strange hard-coded ways is
something I understand, but adding new code that also
acts that way seems like it is getting further away
from "good" :)

Can anything be done to change the behavior in the
HTTPPublicationRequestFactory so that it is not so
obtuse?  My monkey-patch now has to munge two methods
to make xml uploads work and I am less happy with it
than I was before.

Thanks for your time,
John Ziniti



More information about the Zope mailing list