feat: remove default favicon
This commit is contained in:
+1
-1
@@ -16,7 +16,7 @@ class DataDir:
|
|||||||
]
|
]
|
||||||
|
|
||||||
PATH_REGEX = re.compile(r"^[\w-]+$")
|
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:
|
def __init__(self, root_path: str) -> None:
|
||||||
self.logger: logging.Logger = logging.getLogger(self.__class__.__name__)
|
self.logger: logging.Logger = logging.getLogger(self.__class__.__name__)
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 15 KiB |
+1
-1
@@ -294,7 +294,7 @@ class RequestHandler(http.server.SimpleHTTPRequestHandler, BaseHandler):
|
|||||||
UPDATE_PATH_REGEX = re.compile(r"^\/([\w-]+)\/?$")
|
UPDATE_PATH_REGEX = re.compile(r"^\/([\w-]+)\/?$")
|
||||||
GET_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])$")
|
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
|
TOKEN_HEADER = "X-Token" # noqa: S105
|
||||||
HOST_HEADER = "X-Host"
|
HOST_HEADER = "X-Host"
|
||||||
HOST_ONLY_HEADER = "X-Host-Only"
|
HOST_ONLY_HEADER = "X-Host-Only"
|
||||||
|
|||||||
@@ -1227,12 +1227,12 @@ class TestRequestHandler(BaseHandlerTestCase):
|
|||||||
with (
|
with (
|
||||||
self.patch_call(
|
self.patch_call(
|
||||||
"http.server.SimpleHTTPRequestHandler.translate_path",
|
"http.server.SimpleHTTPRequestHandler.translate_path",
|
||||||
["/favicon.ico"],
|
["/robots.txt"],
|
||||||
),
|
),
|
||||||
self.seal_mocks(),
|
self.seal_mocks(),
|
||||||
):
|
):
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
handler.translate_path("/favicon.ico"),
|
handler.translate_path("/robots.txt"),
|
||||||
None,
|
None,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -1269,12 +1269,12 @@ class TestRequestHandler(BaseHandlerTestCase):
|
|||||||
self.mock_call(self.registry.get_from_host, ["example.com"], Page("path")),
|
self.mock_call(self.registry.get_from_host, ["example.com"], Page("path")),
|
||||||
self.patch_call(
|
self.patch_call(
|
||||||
"http.server.SimpleHTTPRequestHandler.translate_path",
|
"http.server.SimpleHTTPRequestHandler.translate_path",
|
||||||
["/favicon.ico"],
|
["/robots.txt"],
|
||||||
),
|
),
|
||||||
self.seal_mocks(),
|
self.seal_mocks(),
|
||||||
):
|
):
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
handler.translate_path("/favicon.ico"),
|
handler.translate_path("/robots.txt"),
|
||||||
None,
|
None,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user