On Fri, Oct 05, 2001 at 12:50:18PM -0400, Andrew Kuchling wrote:
> OK; a proposed patch is below (I'll finish writing the comment before
> checking it in). Mikhail, can you please give it a try with this
> patch and see if your problem is fixed? Greg, Neil: note that this
> code ends up mutating the 'environ' mapping passed into the
> constructor; is that OK or should I .copy() the dictionary first?
> (IMHO I can live with this tiny bit of evil.)
Well, the situation is much better now. :) It works. Unfortunately, I
do not have a Linux computer next to my home PC (it's dual boot), so I
cannot explain the result I get (I'll download some less smart browser
or just wget to see what's exactly happening).
Here we go.
http://localhost/scripts/demo.py/
Works just fine. All the links from the page it shows work just fine as
well. Now let's check
http://localhost/scripts/demo.py
and the result is rather strange. I tried to investigate the problem
and it looks like the following patch needs to be applied. As the
environment dump (which I sent earlier) shows, SERVER_PORT_SECURE is
there even if the connection was not made over SSL.
--
Misha
--- http_request.py.old Sat Oct 6 00:14:20 2001
+++ http_request.py Sat Oct 6 00:13:53 2001
@@ -174,7 +174,7 @@
self.response = HTTPResponse()
if (environ.get('HTTPS', "off").lower() == "on" or
- environ.get('SERVER_PORT_SECURE')):
+ environ.get('SERVER_PORT_SECURE') != "0"):
self.scheme = "https"
else:
self.scheme = "http"