rfk/m2wsgi — Issue #6: REMOTE_ADDR (patch)
Author: steamraven
Created: 2012-01-31 17:11:03+00:00
State: open

REMOTE_ADDR is not inserted into the wsgi environment. T

--- a/m2wsgi/io/base.py
+++ b/m2wsgi/io/base.py
@@ -982,6 +982,7 @@ class WSGIHandler(Handler):
# Let's just hope the client sends a Host header...
environ["SERVER_NAME"] = "localhost"
environ["SERVER_PORT"] = "80"
+ environ["REMOTE_ADDR"] = unquote(req.headers['x-forwarded-for'])
# Include standard wsgi keys
environ['wsgi.input'] = self.get_input_file(req)
# TODO: 100-continue support?