diff options
Diffstat (limited to 'wsgitools/scgi/forkpool.py')
-rw-r--r-- | wsgitools/scgi/forkpool.py | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/wsgitools/scgi/forkpool.py b/wsgitools/scgi/forkpool.py index 39c9dfd..d4e67d4 100644 --- a/wsgitools/scgi/forkpool.py +++ b/wsgitools/scgi/forkpool.py @@ -12,6 +12,8 @@ import sys import errno import signal +from wsgitools.scgi import _convert_environ + if sys.version_info[0] >= 3: def exc_info_for_raise(exc_info): return exc_info[0](exc_info[1]).with_traceback(exc_info[2]) @@ -431,21 +433,10 @@ class SCGIServer: con.close() return + _convert_environ(environ, multiprocess=True) sfw = SocketFileWrapper(con, int(environ["CONTENT_LENGTH"])) - environ.update({ - "wsgi.version": (1, 0), - "wsgi.input": sfw, - "wsgi.errors": self.error, - "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? + environ["wsgi.input"] = sfw + environ["wsgi.errors"] = self.error result = self.wsgiapp(environ, start_response) assert hasattr(result, "__iter__") |