bug in prePathURL breaks proxies (8.2.0)
| Newsgroups | gmane.comp.python.twisted.bugs |
|---|---|
| Message-ID | <[email protected]> |
New submission from exarkun <[email protected]>: Work around a bug in twisted 8.2.0 prePathURL function that breaks HTTP proxies by not properly respecting port numbers in Host: foo.bar.com:<port> style headers. As a result of the incorrect behavior, HTTP redirections fail if an HTTP proxy or IP-stack-level port forward rule remaps the port number of the request so that the port number in the Host header is different from the port number of the receiving transport. For example, suppose I have a port forward rule on my server (foo.bar.com) to redirect port 8443 on my public interface to 127.0.0.1:5000 where a twisted web server is listening. Now I connect with a web browser to http://foo.bar.com:8443/ and get this wrong redirect: Location: https://foo.bar.com:5000/__session_key__3ba5281f1d7598ef02b0e314ef28f6e5/ Of course, the bug is that twisted should have used port 8443 from the HTTP request instead of port 5000 from the transport to build the redirect. This bug will break any port-remapping proxy or forward rule. ---------- Type : defect Component: web Keywords : Priority : normal Nosy : ---------- http://twistedmatrix.com/trac/ticket/3845