Fix log download Content-Type to application/octet-stream
Browser auto-download requires binary MIME type, not text/plain. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -1,21 +1,3 @@
|
|||||||
## Task 6: Get Logging Config — Should include level field
|
|
||||||
|
|
||||||
**Test Result:** FAIL — `Dictionary does not contain key 'level'`
|
|
||||||
|
|
||||||
**Instructions:**
|
|
||||||
The `Get Logging Config` API test expects the response JSON to contain a `level` key, but it is missing. Review the logging configuration endpoint. Ensure the response includes the current logging level (e.g., `INFO`, `DEBUG`, `WARNING`) under the key `level`.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Task 7: Tail Log File — Endpoint should exist and return log tail
|
|
||||||
|
|
||||||
**Test Result:** FAIL — `Url: http://127.0.0.1:8765/api/logging/files/aniworld.log/tail Expected status: 404 != 200`
|
|
||||||
|
|
||||||
**Instructions:**
|
|
||||||
The `Tail Log File` API test expects a `200 OK` from `/api/logging/files/{filename}/tail`, but gets `404 Not Found`. The endpoint does not exist or the route is incorrect. Implement or fix the route so it accepts a filename parameter and returns the last N lines of the requested log file.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Task 8: Download Log File — Endpoint should exist and return log file
|
## Task 8: Download Log File — Endpoint should exist and return log file
|
||||||
|
|
||||||
**Test Result:** FAIL — `Url: http://127.0.0.1:8765/api/logging/files/aniworld.log/download Expected status: 404 != 200`
|
**Test Result:** FAIL — `Url: http://127.0.0.1:8765/api/logging/files/aniworld.log/download Expected status: 404 != 200`
|
||||||
|
|||||||
@@ -163,7 +163,7 @@ def download_file(
|
|||||||
return FileResponse(
|
return FileResponse(
|
||||||
path=str(file_path),
|
path=str(file_path),
|
||||||
filename=safe_name,
|
filename=safe_name,
|
||||||
media_type="text/plain",
|
media_type="application/octet-stream",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user