(self)
| 557 | except Exception as exc: |
| 558 | self._send_sse_event("error", {"ok": False, "error": str(exc)}) |
| 559 | |
| 560 | def do_GET(self) -> None: # noqa: N802 - stdlib hook |
| 561 | path, _query_params = _query(self.path) |
| 562 | if path.startswith("/api/"): |
| 563 | self._handle_api(GET_ROUTES) |
| 564 | return |
| 565 | if path in {"/", "/index.html"}: |
| 566 | self._send_file(STATIC_DIR / "index.html") |
| 567 | return |
| 568 | if path == "/favicon.ico": |
| 569 | self._send_file(STATIC_DIR / "favicon.svg") |
| 570 | return |
| 571 | requested = (STATIC_DIR / path.lstrip("/")).resolve() |
| 572 | try: |
| 573 | requested.relative_to(STATIC_DIR.resolve()) |
| 574 | except ValueError: |
| 575 | self._send_json({"ok": False, "error": "Invalid path"}, status=HTTPStatus.BAD_REQUEST) |
| 576 | return |
| 577 | self._send_file(requested) |
| 578 | |
| 579 | def do_POST(self) -> None: # noqa: N802 - stdlib hook |
nothing calls this directly
no test coverage detected