summaryrefslogtreecommitdiff
path: root/wsgitools/scgi/forkpool.py
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2007-04-25 14:24:13 +0200
committerHelmut Grohne <helmut@subdivi.de>2007-04-25 14:24:13 +0200
commitdfac4c7ad90ccf11d629ee19be01b7999d4ae107 (patch)
tree7a09f21c23a9e1380476a3467c392c775c70295a /wsgitools/scgi/forkpool.py
parent5b5b4992ffdc3c3dc3b28c004f211288fb6affcf (diff)
downloadwsgitools-dfac4c7ad90ccf11d629ee19be01b7999d4ae107.tar.gz
some environ fixups in scgi.*
Diffstat (limited to 'wsgitools/scgi/forkpool.py')
-rw-r--r--wsgitools/scgi/forkpool.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/wsgitools/scgi/forkpool.py b/wsgitools/scgi/forkpool.py
index 6476458..157e320 100644
--- a/wsgitools/scgi/forkpool.py
+++ b/wsgitools/scgi/forkpool.py
@@ -214,10 +214,16 @@ class SCGIServer:
"wsgi.version": (1, 0),
"wsgi.input": SocketFileWrapper(con),
"wsgi.errors": self.error,
- "wsgi.url_scheme": "http", # TODO: this is wrong
+ "wsgi.url_scheme": "http",
"wsgi.multithread": False,
"wsgi.multiprocess": True,
"wsgi.run_once": False})
+ if environ.get("HTTPS", "no").lower() in ('yes', 'y', '1'):
+ environ["wsgi.url_scheme"] = "https"
+ if "HTTP_CONTENT_TYPE" in environ:
+ environ["CONTENT_TYPE"] = environ.pop("HTTP_CONTENT_TYPE")
+ if "HTTP_CONTENT_LENGTH" in environ:
+ del environ["HTTP_CONTENT_LENGTH"] # TODO: better way?
result = self.wsgiapp(environ, start_response)
assert hasattr(result, "__iter__")