diff --git a/stapler/data_dir.py b/stapler/data_dir.py index b805b6c..8608772 100644 --- a/stapler/data_dir.py +++ b/stapler/data_dir.py @@ -16,7 +16,7 @@ class DataDir: ] PATH_REGEX = re.compile(r"^[\w-]+$") - NEEDED_FILES: typing.ClassVar[list[str]] = ["favicon.ico", "robots.txt"] + NEEDED_FILES: typing.ClassVar[list[str]] = ["robots.txt"] def __init__(self, root_path: str) -> None: self.logger: logging.Logger = logging.getLogger(self.__class__.__name__) diff --git a/stapler/favicon.ico b/stapler/favicon.ico deleted file mode 100644 index 1b35660..0000000 Binary files a/stapler/favicon.ico and /dev/null differ diff --git a/stapler/handlers.py b/stapler/handlers.py index c423965..cf95d4c 100644 --- a/stapler/handlers.py +++ b/stapler/handlers.py @@ -294,7 +294,7 @@ class RequestHandler(http.server.SimpleHTTPRequestHandler, BaseHandler): UPDATE_PATH_REGEX = re.compile(r"^\/([\w-]+)\/?$") GET_PATH_REGEX = re.compile(r"^\/([\w-]+)($|\/)") HOST_PART_REGEX = re.compile(r"^([a-z0-9]|[a-z0-9][a-z0-9-]{,61}[a-z0-9])$") - AUTHORIZED_PATHS: typing.ClassVar[list[str]] = ["/favicon.ico", "/robots.txt"] + AUTHORIZED_PATHS: typing.ClassVar[list[str]] = ["/robots.txt"] TOKEN_HEADER = "X-Token" # noqa: S105 HOST_HEADER = "X-Host" HOST_ONLY_HEADER = "X-Host-Only" diff --git a/tests/test_handlers.py b/tests/test_handlers.py index 6f8fdc5..aa9bad6 100644 --- a/tests/test_handlers.py +++ b/tests/test_handlers.py @@ -1227,12 +1227,12 @@ class TestRequestHandler(BaseHandlerTestCase): with ( self.patch_call( "http.server.SimpleHTTPRequestHandler.translate_path", - ["/favicon.ico"], + ["/robots.txt"], ), self.seal_mocks(), ): self.assertEqual( - handler.translate_path("/favicon.ico"), + handler.translate_path("/robots.txt"), None, ) @@ -1269,12 +1269,12 @@ class TestRequestHandler(BaseHandlerTestCase): self.mock_call(self.registry.get_from_host, ["example.com"], Page("path")), self.patch_call( "http.server.SimpleHTTPRequestHandler.translate_path", - ["/favicon.ico"], + ["/robots.txt"], ), self.seal_mocks(), ): self.assertEqual( - handler.translate_path("/favicon.ico"), + handler.translate_path("/robots.txt"), None, )