refactor: centralize ndjson streaming transport
This commit is contained in:
@@ -1020,16 +1020,6 @@ class RequestHandler(
|
||||
return
|
||||
self.send_json({"error": "Not found"}, HTTPStatus.NOT_FOUND)
|
||||
|
||||
|
||||
|
||||
def _write_stream_event(self, payload: dict[str, Any]) -> None:
|
||||
self.wfile.write(
|
||||
(json.dumps(payload, ensure_ascii=False, separators=(",", ":")) + "\n").encode("utf-8")
|
||||
)
|
||||
self.wfile.flush()
|
||||
|
||||
|
||||
|
||||
def save_reason(self) -> None:
|
||||
try:
|
||||
body = self.read_json_body()
|
||||
|
||||
Reference in New Issue
Block a user