1. cherrypy
  2. CherryPy

Source

CherryPy / cherrypy / _cpwsgi_server.py

Diff from to

File cherrypy/_cpwsgi_server.py

 
 class CPHTTPRequest(wsgiserver.HTTPRequest):
     
-    def __init__(self, sendall, environ, wsgi_app):
+    def __init__(self, rfile, wfile, environ, wsgi_app):
         s = cherrypy.server
         self.max_request_header_size = s.max_request_header_size or 0
         self.max_request_body_size = s.max_request_body_size or 0
-        wsgiserver.HTTPRequest.__init__(self, sendall, environ, wsgi_app)
+        wsgiserver.HTTPRequest.__init__(self, rfile, wfile, environ, wsgi_app)
 
 
 class CPHTTPConnection(wsgiserver.HTTPConnection):
         # We have to make custom subclasses of wsgiserver internals here
         # so that our server.* attributes get applied to every request.
         class _CPHTTPRequest(wsgiserver.HTTPRequest):
-            def __init__(self, sendall, environ, wsgi_app):
+            def __init__(self, rfile, wfile, environ, wsgi_app):
                 s = server_adapter
                 self.max_request_header_size = s.max_request_header_size or 0
                 self.max_request_body_size = s.max_request_body_size or 0
-                wsgiserver.HTTPRequest.__init__(self, sendall, environ, wsgi_app)
+                wsgiserver.HTTPRequest.__init__(self, rfile, wfile, environ, wsgi_app)
         class _CPHTTPConnection(wsgiserver.HTTPConnection):
             RequestHandlerClass = _CPHTTPRequest
         self.ConnectionClass = _CPHTTPConnection
         self.protocol = self.server_adapter.protocol_version
         self.nodelay = self.server_adapter.nodelay
         
+        self.environ["wsgi.version"] = self.server_adapter.wsgi_version
+        
         if self.server_adapter.ssl_context:
             adapter_class = self.get_ssl_adapter_class()
             s.ssl_adapter = adapter_class(self.server_adapter.ssl_certificate,