(self, payload: Dict[str, Any], status: int = 200)
| 489 | server_version = "PaperFlowGUI/0.1" |
| 490 | |
| 491 | def _send_json(self, payload: Dict[str, Any], status: int = 200) -> None: |
| 492 | data = _json_bytes(payload) |
| 493 | self.send_response(status) |
| 494 | self.send_header("Content-Type", "application/json; charset=utf-8") |
| 495 | self.send_header("Content-Length", str(len(data))) |
| 496 | self.send_header("Cache-Control", "no-store") |
| 497 | self.end_headers() |
| 498 | self.wfile.write(data) |
| 499 | |
| 500 | def _send_file(self, path: Path) -> None: |
| 501 | if not path.exists() or not path.is_file(): |
no test coverage detected