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

Magnus Hult magnus at spotify.com
Wed Dec 13 10:19:44 EST 2006


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)

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

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?


More information about the Twisted-Python mailing list