smodusermc commited on
Commit
35f7916
·
verified ·
1 Parent(s): ace5dae

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -316,8 +316,9 @@ async def upload_chunk(
316
  # File Download
317
  # ------------------------------------------------------------------------
318
  @app.get("/api/download/{file_path:path}")
319
- async def download_file(file_path: str, token: str = Header(..., alias="X-Auth-Token")):
320
- user = await authenticate_user(token)
 
321
  if not user: raise HTTPException(401)
322
  if '..' in file_path: raise HTTPException(400)
323
  try:
 
316
  # File Download
317
  # ------------------------------------------------------------------------
318
  @app.get("/api/download/{file_path:path}")
319
+ async def download_file(file_path: str, token: str = Header(None, alias="X-Auth-Token"), t: str = Query(None)):
320
+ auth_token = token or t
321
+ user = await authenticate_user(auth_token)
322
  if not user: raise HTTPException(401)
323
  if '..' in file_path: raise HTTPException(400)
324
  try: