Fix all high and medium severity security issues found by Bandit

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-02-07 19:35:40 +00:00
parent 68143a2689
commit edd1acb3a1
13 changed files with 55 additions and 23 deletions
+2 -2
View File
@@ -49,7 +49,7 @@ def poll_task_for_document_id(task_id: str) -> int:
while attempts < POLL_MAX_ATTEMPTS:
try:
resp = requests.get(url, headers=_get_headers(), params={"task_id": task_id})
resp = requests.get(url, headers=_get_headers(), params={"task_id": task_id}, timeout=settings.http_request_timeout)
resp.raise_for_status()
tasks_data = resp.json()
except requests.exceptions.RequestException as exc:
@@ -125,7 +125,7 @@ def upload_to_paperless(self, file_path: str, file_id: int = None):
try:
logger.debug("Posting document to Paperless: file=%s", filename)
resp = requests.post(post_url, headers=_get_headers(), files=files, data=data)
resp = requests.post(post_url, headers=_get_headers(), files=files, data=data, timeout=settings.http_request_timeout)
resp.raise_for_status()
except requests.exceptions.RequestException as exc:
error_msg = f"Failed to upload to Paperless: {exc}"