MCPcopy Index your code
hub / github.com/vastsa/FileCodeBox / get_code_file

Function get_code_file

apps/base/views.py:280–289  ·  view source on GitHub ↗
(code: str, ip: str = Depends(ip_limit["error"]))

Source from the content-addressed store, hash-verified

278
279@share_api.get("/select/")
280async 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/")

Callers

nothing calls this directly

Calls 5

APIResponseClass · 0.90
get_code_file_by_codeFunction · 0.85
update_file_usageFunction · 0.85
add_ipMethod · 0.80
get_file_responseMethod · 0.45

Tested by

no test coverage detected