(path)
| 269 | |
| 270 | @app.put("/file/<path:path>") |
| 271 | async 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 |
nothing calls this directly
no test coverage detected