Add a config key to ignore reverse DNS (fixes #779)

This commit is contained in:
Guillaume Ayoub
2012-03-13 09:35:01 +01:00
parent 7bfc17a51d
commit 344f87d8fb
3 changed files with 12 additions and 1 deletions

View File

@@ -105,6 +105,14 @@ class RequestHandler(wsgiref.simple_server.WSGIRequestHandler):
def log_message(self, *args, **kwargs):
"""Disable inner logging management."""
def address_string(self):
"""Client address, formatted for logging."""
if config.getboolean("server", "dns_lookup"):
return \
wsgiref.simple_server.WSGIRequestHandler.address_string(self)
else:
return self.client_address[0]
class Application(object):
"""WSGI application managing collections."""