summaryrefslogtreecommitdiff
path: root/paste/httpserver.py
diff options
context:
space:
mode:
authorianb <devnull@localhost>2007-02-05 17:18:17 +0000
committerianb <devnull@localhost>2007-02-05 17:18:17 +0000
commita031c7194bc1916921863a13f712669b02d393cc (patch)
treefab63e0277e878c43d6b3db9e6cd2e70ee4e325b /paste/httpserver.py
parent0bcc07fc537eda79a5f01b6d4904ffe29248a680 (diff)
downloadpaste-a031c7194bc1916921863a13f712669b02d393cc.tar.gz
Do not set REMOTE_HOST, as it requires a reverse DNS lookup
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