(res)
| 579 | } |
| 580 | |
| 581 | async function safeJson(res) { |
| 582 | const ct = res.headers.get('content-type') || ''; |
| 583 | if (!/application\/json/i.test(ct)) return null; |
| 584 | try { return await res.clone().json(); } catch (e) { return null; } |
| 585 | } |
| 586 | |
| 587 | async function sniffTOTP(res, bodyMaybe) { |
| 588 | if (res.headers.get('X-TOTP-Required') === '1') return true; |
no test coverage detected