From a031c7194bc1916921863a13f712669b02d393cc Mon Sep 17 00:00:00 2001 From: ianb Date: Mon, 5 Feb 2007 17:18:17 +0000 Subject: Do not set REMOTE_HOST, as it requires a reverse DNS lookup --- paste/httpserver.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'paste/httpserver.py') 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 -- cgit v1.2.1