Log full qBittorrent login response headers
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
2026-05-20 19:27:01 +02:00
parent dca9312753
commit d2a4f3dbad
+1 -2
View File
@@ -22,12 +22,11 @@ async function getCookie(): Promise<string> {
new URLSearchParams({ username: user, password: pass }), new URLSearchParams({ username: user, password: pass }),
{ {
headers: { 'Content-Type': 'application/x-www-form-urlencoded', 'Referer': host, 'Origin': host }, headers: { 'Content-Type': 'application/x-www-form-urlencoded', 'Referer': host, 'Origin': host },
maxRedirects: 0,
validateStatus: s => s < 400, validateStatus: s => s < 400,
} }
) )
console.log(`[qbt] login status=${res.status} body=${JSON.stringify(res.data)} cookies=${JSON.stringify(res.headers['set-cookie'])}`) console.log(`[qbt] status=${res.status} headers=${JSON.stringify(res.headers)} body=${JSON.stringify(res.data)}`)
const cookie = (res.headers['set-cookie'] ?? []).find((c: string) => c.startsWith('SID=')) const cookie = (res.headers['set-cookie'] ?? []).find((c: string) => c.startsWith('SID='))
if (!cookie) throw new Error(`qBittorrent login failed (${res.status}): "${String(res.data).trim()}"`) if (!cookie) throw new Error(`qBittorrent login failed (${res.status}): "${String(res.data).trim()}"`)