Spaces:
Running
Running
Update app.py
Browse files
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(
|
| 320 |
-
|
|
|
|
| 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:
|