]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Make WSGIContainer._environ public and static, so it can be used to adapt
authorBen Darnell <bdarnell@beaker.local>
Mon, 7 Dec 2009 23:47:16 +0000 (15:47 -0800)
committerBen Darnell <bdarnell@beaker.local>
Mon, 7 Dec 2009 23:47:16 +0000 (15:47 -0800)
tornado requests to WSGI environments without a full WSGIContainer.

tornado/wsgi.py

index 1dd02298ec368549dea5a442dac2d9d21c6c1afa..9b54d00f39c24e19f0209d7de2c1eb54ab855dcf 100644 (file)
@@ -214,7 +214,7 @@ class WSGIContainer(object):
             data["status"] = status
             data["headers"] = HTTPHeaders(response_headers)
         body = "".join(self.wsgi_application(
-            self._environ(request), start_response))
+            WSGIContainer.environ(request), start_response))
         if not data: raise Exception("WSGI app did not call start_response")
 
         status_code = int(data["status"].split()[0])
@@ -233,7 +233,8 @@ class WSGIContainer(object):
         request.finish()
         self._log(status_code, request)
 
-    def _environ(self, request):
+    @staticmethod
+    def environ(request):
         hostport = request.host.split(":")
         if len(hostport) == 2:
             host = hostport[0]