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
|
# Available ciphers. See python's ssl module for available ciphers
|
||||||
#ciphers =
|
#ciphers =
|
||||||
|
|
||||||
# Reverse DNS to resolve client address in logs
|
|
||||||
#dns_lookup = True
|
|
||||||
|
|
||||||
|
|
||||||
[encoding]
|
[encoding]
|
||||||
|
|
||||||
|
@ -135,11 +135,7 @@ DEFAULT_CONFIG_SCHEMA = OrderedDict([
|
|||||||
("ciphers", {
|
("ciphers", {
|
||||||
"value": "",
|
"value": "",
|
||||||
"help": "available ciphers",
|
"help": "available ciphers",
|
||||||
"type": str}),
|
"type": str})])),
|
||||||
("dns_lookup", {
|
|
||||||
"value": "True",
|
|
||||||
"help": "use reverse DNS to resolve client address in logs",
|
|
||||||
"type": bool})])),
|
|
||||||
("encoding", OrderedDict([
|
("encoding", OrderedDict([
|
||||||
("request", {
|
("request", {
|
||||||
"value": "utf-8",
|
"value": "utf-8",
|
||||||
|
@ -281,11 +281,6 @@ def serve(configuration, shutdown_socket=None):
|
|||||||
raise RuntimeError("Failed to read SSL %s %r: %s" %
|
raise RuntimeError("Failed to read SSL %s %r: %s" %
|
||||||
(name, filename, e)) from e
|
(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:
|
if systemd:
|
||||||
listen_fds = systemd.daemon.listen_fds()
|
listen_fds = systemd.daemon.listen_fds()
|
||||||
else:
|
else:
|
||||||
@ -305,7 +300,7 @@ def serve(configuration, shutdown_socket=None):
|
|||||||
application = Application(configuration)
|
application = Application(configuration)
|
||||||
for server_address in server_addresses:
|
for server_address in server_addresses:
|
||||||
try:
|
try:
|
||||||
server = ServerCopy(server_address, RequestHandlerCopy)
|
server = ServerCopy(server_address, RequestHandler)
|
||||||
server.set_app(application)
|
server.set_app(application)
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
raise RuntimeError(
|
raise RuntimeError(
|
||||||
|
Loading…
Reference in New Issue
Block a user