From f96a1d3798de9f40729565a9b28961b7a9b828c3 Mon Sep 17 00:00:00 2001 From: Eric Brown Date: Sun, 17 Mar 2024 20:41:58 -0700 Subject: [PATCH] Fix wrong examples in docstring of xmlrpc (#369) Copy-and-paste typos Signed-off-by: Eric Brown --- .../stdlib/xmlrpc_server_unrestricted_bind.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/precli/rules/python/stdlib/xmlrpc_server_unrestricted_bind.py b/precli/rules/python/stdlib/xmlrpc_server_unrestricted_bind.py index b8cc710b..33443bff 100644 --- a/precli/rules/python/stdlib/xmlrpc_server_unrestricted_bind.py +++ b/precli/rules/python/stdlib/xmlrpc_server_unrestricted_bind.py @@ -20,12 +20,12 @@ ## Example ```python -from http.server import BaseHTTPRequestHandler -from http.server import HTTPServer +from xmlrpc.server import DocXMLRPCRequestHandler +from xmlrpc.server import DocXMLRPCServer -def run(server_class: HTTPServer, handler_class: BaseHTTPRequestHandler): - server_address = ("", 8000) +def run(server_class: DocXMLRPCServer, handler_class: DocXMLRPCRequestHandler): + server_address = ("::", 8000) httpd = server_class(server_address, handler_class) httpd.serve_forever() ``` @@ -38,11 +38,11 @@ def run(server_class: HTTPServer, handler_class: BaseHTTPRequestHandler): practice ensures that services are not exposed more broadly than intended. ```python -from http.server import BaseHTTPRequestHandler -from http.server import HTTPServer +from xmlrpc.server import DocXMLRPCRequestHandler +from xmlrpc.server import DocXMLRPCServer -def run(server_class: HTTPServer, handler_class: BaseHTTPRequestHandler): +def run(server_class: DocXMLRPCServer, handler_class: DocXMLRPCRequestHandler): server_address = ("127.0.0.1", 8000) httpd = server_class(server_address, handler_class) httpd.serve_forever()