Keep server details out of API answers
An unexpected error now sends a general message, and the log keeps the text. A job no longer shows the path of its uploaded file. A cover is cached only by the browser of the user.
This commit is contained in:
@@ -161,3 +161,9 @@ def test_finished_jobs_leave_the_database(tmp_path, monkeypatch):
|
||||
old.updated = datetime.now() - timedelta(seconds=config.JOB_HISTORY + 1)
|
||||
queue.get_status()
|
||||
assert JobQueue(tmp_path / "db.sqlite").get_status() == []
|
||||
|
||||
|
||||
def test_the_api_form_of_a_job_hides_the_path_of_an_upload():
|
||||
job = Job(mode=DownloadMode.IMPORT_FILE, options={"path": "/config/uploads/x.epub", "name": "x.epub"})
|
||||
assert job.to_dict()["options"] == {"name": "x.epub"}
|
||||
assert Job.from_record(job.to_record()).options == job.options
|
||||
|
||||
Reference in New Issue
Block a user