[Twisted-Python] twisted.web.proxy.ReverseProxyResource forgets to quote path?

Magnus Hult magnus at spotify.com
Wed Dec 13 08:19:44 MST 2006


Hello,

In a program like this

  from twisted.web import server, proxy, resource
  from twisted.internet import reactor
  from twisted.application import service, strports

  site = server.Site(proxy.ReverseProxyResource('www.example.com', 80, '/path'))
  application = service.Application("accesspoint")
  s = strports.service('tcp:8060', site)
  s.setServiceParent(application)

visiting / on port 8060 leads to www.example.com:80/path as expected.
/test returns the contents of www.example.com:80/path/test as
expected, but going to, for example, /test%20test returns a 400 bad
request.

It seems like t.w.proxy.ReverseProxyResource does not quote its path.
When urllib.quote:ing the rest parameter sent to ProxyClientFactory in
ReverseProxyResource.render, it suddenly works. (I'm using
python-twisted-web from Debian unstable, but it's the same in trunk.)

Am I doing something wrong here or is this a bug?

Regards,
Magnus




More information about the Twisted-Python mailing list