Remove reverse DNS lookup

It wasn't working for years because the functionality was removed from http.server.
Nobody complained.
This commit is contained in:
Unrud 2020-02-19 09:48:34 +01:00
parent db7587c593
commit 4a43b17840
3 changed files with 2 additions and 14 deletions

3
config
View File

@ -45,9 +45,6 @@
# Available ciphers. See python's ssl module for available ciphers
#ciphers =
# Reverse DNS to resolve client address in logs
#dns_lookup = True
[encoding]

View File

@ -135,11 +135,7 @@ DEFAULT_CONFIG_SCHEMA = OrderedDict([
("ciphers", {
"value": "",
"help": "available ciphers",
"type": str}),
("dns_lookup", {
"value": "True",
"help": "use reverse DNS to resolve client address in logs",
"type": bool})])),
"type": str})])),
("encoding", OrderedDict([
("request", {
"value": "utf-8",

View File

@ -281,11 +281,6 @@ def serve(configuration, shutdown_socket=None):
raise RuntimeError("Failed to read SSL %s %r: %s" %
(name, filename, e)) from e
class RequestHandlerCopy(RequestHandler):
"""Copy, avoids overriding the original class attributes."""
if not configuration.get("server", "dns_lookup"):
RequestHandlerCopy.address_string = lambda self: self.client_address[0]
if systemd:
listen_fds = systemd.daemon.listen_fds()
else:
@ -305,7 +300,7 @@ def serve(configuration, shutdown_socket=None):
application = Application(configuration)
for server_address in server_addresses:
try:
server = ServerCopy(server_address, RequestHandlerCopy)
server = ServerCopy(server_address, RequestHandler)
server.set_app(application)
except OSError as e:
raise RuntimeError(