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:
parent
db7587c593
commit
4a43b17840
3
config
3
config
@ -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]
|
||||
|
||||
|
@ -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",
|
||||
|
@ -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(
|
||||
|
Loading…
Reference in New Issue
Block a user