summaryrefslogtreecommitdiff
path: root/wsgitools/scgi/__init__.py
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2012-03-17 20:16:12 +0100
committerHelmut Grohne <helmut@subdivi.de>2012-03-17 20:16:12 +0100
commit4408cef2a6d161bc2af77412920ade8bab648dbd (patch)
tree5de863eb88e43117004730dc7f1bd56be5723305 /wsgitools/scgi/__init__.py
parent492606108a2a5565efc39aed3b56f2e4a6f3c945 (diff)
downloadwsgitools-4408cef2a6d161bc2af77412920ade8bab648dbd.tar.gz
deduplicate scgi.{asynchronous,forkpool}
Diffstat (limited to 'wsgitools/scgi/__init__.py')
-rw-r--r--wsgitools/scgi/__init__.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/wsgitools/scgi/__init__.py b/wsgitools/scgi/__init__.py
index e69de29..20f6625 100644
--- a/wsgitools/scgi/__init__.py
+++ b/wsgitools/scgi/__init__.py
@@ -0,0 +1,15 @@
+def _convert_environ(environ, multithread=False, multiprocess=False,
+ run_once=False):
+ environ.update({
+ "wsgi.version": (1, 0),
+ "wsgi.url_scheme": "http",
+ "wsgi.multithread": multithread,
+ "wsgi.multiprocess": multiprocess,
+ "wsgi.run_once": run_once})
+ if environ.get("HTTPS", "no").lower() in ('yes', 'y', 'on', '1'):
+ environ["wsgi.url_scheme"] = "https"
+ try:
+ environ["CONTENT_TYPE"] = environ.pop("HTTP_CONTENT_TYPE")
+ except KeyError:
+ pass
+ environ.pop("HTTP_CONTENT_LENGTH", None) # TODO: better way?