MCPcopy Index your code
hub / github.com/astral-sh/python-build-standalone / upload_file

Function upload_file

src/github_api_tester.py:271–281  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

269
270@app.put("/file/<path:path>")
271async def upload_file(path):
272 logging.info(f"{path}: upload begin")
273 s = hashlib.sha256()
274 async for chunk in request.body:
275 logging.debug(f"{path}: {len(chunk)=}")
276 if "drop" in request.args:
277 await drop_connection()
278 s.update(chunk)
279 digest = s.hexdigest()
280 logging.info(f"{path}: {digest=}")
281 return f"{digest} {path}\n", 500
282
283
284# Test cases

Callers

nothing calls this directly

Calls 2

drop_connectionFunction · 0.85
updateMethod · 0.80

Tested by

no test coverage detected