7e53edfcc6
qBittorrent (or its reverse proxy) was returning 204 No Content with an SID
cookie and no body on a successful login, but the client only treated the
response as success if body == "Ok." or the cookie was in the parsed
requests cookie jar (resp.cookies.get("SID")). In the reported case the
Set-Cookie header was present (set-cookie=yes) yet the jar was empty —
requests doesn't always populate the jar from such headers (proxy-set/oddly-
attributed cookies) — so a valid login was reported as "Unexpected response".
The user re-entering correct credentials never helped.
Detect a successful login from EITHER the parsed jar OR the raw Set-Cookie
header (cookie name == SID). qBittorrent only sets SID on a valid login, so
this remains authoritative. The diagnostic now lists the cookie names it saw
for future-proofing.
New regression test reproduces the exact 204 + Set-Cookie SID + empty jar
case. 387/387 backend tests pass; ruff clean.
772 B
772 B
backend/src/media_library_viewer_api/clients (index)
dir: backend/src/media_library_viewer_api/clients
role
Provides external service integration clients for authenticating users and aggregating media, filesystem, and torrent data from APIs and remote/local hosts.
parent
index: backend/src/media_library_viewer_api/.pi-map.index.md map: backend/src/media_library_viewer_api/.pi-map.md
children
files
- __init__.py
- authentik.py
- http_timeout.py
- jellyfin.py
- jellyseerr.py
- local.py
- qbittorrent.py
- ssh.py
links
index: backend/src/media_library_viewer_api/clients/.pi-map.index.md map: backend/src/media_library_viewer_api/clients/.pi-map.md
workflows
- change clients behavior read: __init__.py, authentik.py, http_timeout.py