bug in prePathURL breaks proxies (8.2.0)

[email protected]
Newsgroups gmane.comp.python.twisted.bugs
Message-ID <[email protected]>
New submission from jamesyonan <None>:

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.

I am submitting a patch as well to fix the issue.



----------
Type     : defect
Component: core
Keywords : 
Priority : normal
Nosy     : 
----------
http://twistedmatrix.com/trac/ticket/3850
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.