From 118daf1e8c549026d714071c8ec41ef0a6c71b30 Mon Sep 17 00:00:00 2001 From: Klemek Date: Fri, 17 Jul 2026 16:03:18 +0200 Subject: [PATCH] feat: remove default favicon --- stapler/data_dir.py | 2 +- stapler/favicon.ico | Bin 15086 -> 0 bytes stapler/handlers.py | 2 +- tests/test_handlers.py | 8 ++++---- 4 files changed, 6 insertions(+), 6 deletions(-) delete mode 100644 stapler/favicon.ico 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 1b356603ed9f5e9e07a5d2a748d7cd66c61997ee..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 15086 zcmeI3$xl;J6vm&?r320bie;!w+E$=ITPPqPl%ZkJjk++BC~ieJ2!<8Nf+=Fqn7C6! z+z>+|LevE=bfwV^Q%wW~|BB;x9(~e*mZ2(bI8AJr%4B5K^%w&2|y1Le@sylNCqh&6`Ta8 zfMITmOyD#~o13I`kO9mfb9R!lfCX5A4dl#DP%f~4pP)RD52XCz-TtxT!=xV@q!Xiq zl;|c2$7GNKQi1Np?OClbf`W=alXy14rYhan*hdt}m2@w8f2eWPofS z$4&050m^;%GGzNHy;wl!v!jEO_;E}vzooY&=yUvc?DtyK@~3?mUGZ7xg?uT$w7-{~ zgp2*u=EYG-UAc-L{g%i7VD?{rsgTO*%E;2+=eGYbuX=g*u_|XeRbDA0N7J=`X8#p6 zS$^|Zu<{$xUp?oqVEwnK^Y&kxzXFXvQvSf>r?mf)|0edcICo3`U7!Cf_9ONa%KA&} zN9;%JXVC^ceO&S1Mg#i);=hUi=Gj;HT>Llj-#l$X#!nePSF`^w{-^k#;(v<&8E*bV zr0<`5&c*Wm%fEkd`^fjZ845K2MvDDJ`uA(mZ;1XRnEw+<7bMsJPYbY4O9%47N;)k~ zqs96x)@JQxZEs}*}Hb{Ouq}Jcs-Ap#5b3krqBiR{TvGTlsDYJ>iTE4-&}SN)BLbieSfVj#_v8~ZeXBfj7)u-$E-jHma>fpd-_us-Rf!nPY!f%8gWN1Tsu{shDYY5lSIdNo;l z?)*vT^)!>CzG^9rHNS8Ec<_S4n0to?*)zoGV@_4eOT2dUpD%=p^? 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, )