MCPcopy Create free account
hub / github.com/EvoMap/evolver / responseFromHtml

Function responseFromHtml

test/lifecycleReauthHubUnreachable.test.js:47–54  ·  view source on GitHub ↗
({ status = 403, html = '<html><body>403 Forbidden (WAF)</body></html>' } = {})

Source from the content-addressed store, hash-verified

45// has no `json()` body the API path can parse. readHubResponseText falls back
46// to `res.text()` here since there is no streaming body.getReader.
47function responseFromHtml({ status = 403, html = '<html><body>403 Forbidden (WAF)</body></html>' } = {}) {
48 return {
49 ok: status >= 200 && status < 300,
50 status,
51 headers: { get: (k) => (k.toLowerCase() === 'content-type' ? 'text/html; charset=utf-8' : null) },
52 text: async () => html,
53 };
54}
55
56function responseFromJson({ status = 200, json = {}, headers = {} } = {}) {
57 const merged = { 'content-type': 'application/json', ...headers };

Calls

no outgoing calls

Tested by

no test coverage detected