summaryrefslogtreecommitdiff
path: root/paste/httpserver.py
diff options
context:
space:
mode:
Diffstat (limited to 'paste/httpserver.py')
-rwxr-xr-xpaste/httpserver.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/paste/httpserver.py b/paste/httpserver.py
index a5aa664..a2eb634 100755
--- a/paste/httpserver.py
+++ b/paste/httpserver.py
@@ -206,9 +206,12 @@ class WSGIHandlerMixin:
,'SERVER_PROTOCOL': self.request_version
# CGI not required by PEP-333
,'REMOTE_ADDR': self.client_address[0]
- ,'REMOTE_HOST': self.address_string()
}
+ address_string = self.address_string()
+ if address_string:
+ self.wsgi_environ['REMOTE_HOST'] = address_string
+
if hasattr(self.server, 'thread_pool'):
# Now that we know what the request was for, we should
# tell the thread pool what its worker is working on
@@ -389,6 +392,13 @@ class WSGIHandler(WSGIHandlerMixin, BaseHTTPRequestHandler):
except SocketErrors, exce:
self.wsgi_connection_drop(exce)
+ def address_string(self):
+ """Return the client address formatted for logging.
+
+ This is overridden so that no hostname lookup is done.
+ """
+ return ''
+
class LimitedLengthFile(object):
def __init__(self, file, length):
self.file = file