1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-vps-admin.git synced 2025-02-12 10:31:52 +00:00

Require authentication for upload and download test

This commit is contained in:
Ycarus (Yannick Chabanois) 2023-12-15 19:31:57 +01:00
parent a24cc293db
commit 54a568e5d1

View file

@ -3205,11 +3205,11 @@ async def list_users(current_user: User = Depends(get_current_user)):
return content['users'][0]
@app.get('/speedtest', summary="Test speed from the server")
async def speedtest():
async def speedtest(current_user: User = Depends(get_current_user)):
return FileResponse('/usr/share/omr-server/speedtest/test.img')
@app.post('/speedtest', summary="Test upload speed from the server")
async def speedtestul(file: UploadFile):
async def speedtestul(file: UploadFile, current_user: User = Depends(get_current_user)):
if not file:
return {'result': 'No upload file sent'}
else: