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 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

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