From 55a59b36d930df36c31a3dae3fbfff14d4e5d57c Mon Sep 17 00:00:00 2001 From: klemek Date: Sun, 12 Apr 2026 18:20:55 +0200 Subject: [PATCH] fix: version reading --- src/handler.py | 2 +- src/project.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/handler.py b/src/handler.py index 35e4730..3278d79 100644 --- a/src/handler.py +++ b/src/handler.py @@ -19,7 +19,7 @@ class RequestHandler(http.server.SimpleHTTPRequestHandler): server_version = "StaplerServer/" + project.get_version() CERTBOT_CHALLENGE_PATH = "/.well-known/acme-challenge" PATH_REGEX = re.compile(r"^\/([\w-]+)\/") - HOST_PART_REGEX = re.compile(r"^[a-zA-Z0-9]*[a-zA-Z0-9][a-zA-Z0-9]$") + HOST_PART_REGEX = re.compile(r"^([a-zA-Z0-9]|[a-zA-Z0-9]*[a-zA-Z0-9][a-zA-Z0-9])$") HOST_PORT_REGEX = re.compile(r"^\d{2,5}$") @typing.override diff --git a/src/project.py b/src/project.py index b2cdb27..13f6874 100644 --- a/src/project.py +++ b/src/project.py @@ -5,7 +5,7 @@ import toml def __get_project_data() -> None | dict[str, typing.Any]: - pyproject_toml_file = pathlib.Path(__file__) / ".." / ".." / "pyproject.toml" + pyproject_toml_file = pathlib.Path(__file__).parent.parent / "pyproject.toml" if pyproject_toml_file.is_file(): try: data = toml.load(pyproject_toml_file)