MCPcopy Create free account
hub / github.com/error311/FileRise / safeJson

Function safeJson

public/js/auth.js:581–585  ·  view source on GitHub ↗
(res)

Source from the content-addressed store, hash-verified

579}
580
581async 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
587async function sniffTOTP(res, bodyMaybe) {
588 if (res.headers.get('X-TOTP-Required') === '1') return true;

Callers 2

sniffTOTPFunction · 0.70
submitLoginFunction · 0.70

Calls 1

getMethod · 0.45

Tested by

no test coverage detected