MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / do_GET

Method do_GET

deployments/desktop/server.py:559–576  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 4

_handle_apiMethod · 0.95
_send_fileMethod · 0.95
_send_jsonMethod · 0.95
_queryFunction · 0.85

Tested by

no test coverage detected