(code: str, ip: str = Depends(ip_limit["error"]))
| 278 | |
| 279 | @share_api.get("/select/") |
| 280 | async def get_code_file(code: str, ip: str = Depends(ip_limit["error"])): |
| 281 | file_storage: FileStorageInterface = storages[settings.file_storage]() |
| 282 | has, file_code = await get_code_file_by_code(code) |
| 283 | if not has: |
| 284 | ip_limit["error"].add_ip(ip) |
| 285 | return APIResponse(code=404, detail=file_code) |
| 286 | |
| 287 | assert isinstance(file_code, FileCodes) |
| 288 | await update_file_usage(file_code) |
| 289 | return await file_storage.get_file_response(file_code) |
| 290 | |
| 291 | |
| 292 | @share_api.post("/select/") |
nothing calls this directly
no test coverage detected