Fix server threading, tag URLs, and tag date resolution

- Switch to ThreadingHTTPServer to handle concurrent requests
- Catch BrokenPipeError on response writes to suppress noisy tracebacks
- Change tag URL from /tags/ to /releases/tag/
- Resolve tag dates via commit SHA from tags API + commits endpoint (works for public repos without auth)
- Update tests to match new tag date resolution approach
This commit is contained in:
2026-07-28 12:25:04 +02:00
parent 7aeecc1e15
commit e1bd1ad9eb
4 changed files with 39 additions and 54 deletions
+12 -3
View File
@@ -39,20 +39,29 @@ def create_handler(db_path: str):
self.send_response(200)
self.send_header("Content-Type", "application/rss+xml; charset=utf-8")
self.end_headers()
self.wfile.write(feed_xml.encode("utf-8"))
try:
self.wfile.write(feed_xml.encode("utf-8"))
except BrokenPipeError:
pass
def _serve_index(self):
html = generate_index_html(self._base_url())
self.send_response(200)
self.send_header("Content-Type", "text/html; charset=utf-8")
self.end_headers()
self.wfile.write(html.encode("utf-8"))
try:
self.wfile.write(html.encode("utf-8"))
except BrokenPipeError:
pass
def _serve_health(self):
self.send_response(200)
self.send_header("Content-Type", "text/plain")
self.end_headers()
self.wfile.write(b"OK")
try:
self.wfile.write(b"OK")
except BrokenPipeError:
pass
def _base_url(self) -> str:
host = self.server.server_address[0]