Commits

Denis Bilenko committed 6406c92

pywsgi: put REMOTE_PORT in environ

  • Participants
  • Parent commits d08b625

Comments (0)

Files changed (1)

             env['CONTENT_LENGTH'] = length
         env['SERVER_PROTOCOL'] = 'HTTP/1.0'
 
-        env['REMOTE_ADDR'] = self.client_address[0]
+        client_address = self.client_address
+        if isinstance(client_address, tuple):
+            env['REMOTE_ADDR'] = str(client_address[0])
+            env['REMOTE_PORT'] = str(client_address[1])
 
         for header in self.headers.headers:
             key, value = header.split(':', 1)