summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Devaev <[email protected]>2022-07-23 08:50:20 +0300
committerMaxim Devaev <[email protected]>2022-07-23 08:50:20 +0300
commit3e402f4d7b6817a2c2d8b6f3cea46da5420e8dc1 (patch)
treea33f904c0516ae86e61267d25a6a885318a4958f
parent5b11b6bc55d9e32b4802ca86b7b66aea827025ce (diff)
refactoring
-rw-r--r--kvmd/apps/kvmd/api/msd.py2
-rw-r--r--kvmd/htserver.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/kvmd/apps/kvmd/api/msd.py b/kvmd/apps/kvmd/api/msd.py
index 75852dd7..cedc0aa1 100644
--- a/kvmd/apps/kvmd/api/msd.py
+++ b/kvmd/apps/kvmd/api/msd.py
@@ -129,7 +129,7 @@ class MsdApi:
get_logger(0).info("Downloading image %r as %r to MSD ...", url, name)
async with self.__msd.write_image(name, size) as chunk_size:
- response = await start_streaming(request)
+ response = await start_streaming(request, "application/x-ndjson")
await stream_write_info()
last_report_ts = 0
async for chunk in remote.content.iter_chunked(chunk_size):
diff --git a/kvmd/htserver.py b/kvmd/htserver.py
index df687989..af4498c1 100644
--- a/kvmd/htserver.py
+++ b/kvmd/htserver.py
@@ -187,7 +187,7 @@ def make_json_exception(err: Exception, status: Optional[int]=None) -> Response:
}, status=status)
-async def start_streaming(request: Request, content_type: str="application/x-ndjson") -> StreamResponse:
+async def start_streaming(request: Request, content_type: str) -> StreamResponse:
response = StreamResponse(status=200, reason="OK", headers={"Content-Type": content_type})
await response.prepare(request)
return response