diegonehab/luasocket — pull request #96 by chastabor (2014-03-27 14:12:47+00:00)
Title: Generate headers before proxy changes host and port

Currently tests show that the code sends proxy info in the Host header. This can affect tomcat as it uses this information when generating pages. Test example of the header being sent out:
GET http://gato-public-st.tr.txstate.edu:80/testing-site/tests/redirect-pages/redirect-local.html HTTP/1.1
Host: 127.0.0.1:3128
TE: trailers
Connection: close, TE
User-Agent: lua 5.1, autotest

We can changed the order where the proxy updates the host and port after the headers are generated; so the actual host and port that we want to send would be put into the header. Test example of the header being sent out when we run adjustheaders before adjustproxy:
GET http://gato-public-st.tr.txstate.edu:80/testing-site/tests/redirect-pages/redirect-local.html HTTP/1.1
Host: gato-public-st.tr.txstate.edu:80
TE: trailers
Connection: close, TE
User-Agent: lua 5.1, autotest