Skip to content

Commit f697993

Browse files
authored
(fix): Follow Up to 310 - Adding more details to failed trustless test (#312)
1 parent 4a2c926 commit f697993

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/Trustless.ts

+8-4
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,16 @@ class Trustless extends CheckBase implements Checkable {
3030
}
3131
))
3232

33-
if (!trustlessResponseTypesTests.includes(false)) {
33+
const failedTests = TRUSTLESS_RESPONSE_TYPES.filter((_result, idx) => !trustlessResponseTypesTests[idx])
34+
35+
if (failedTests.length === 0) {
3436
this.tag.win()
3537
} else {
36-
log.debug('The response type did not match the expected type')
37-
this.onerror()
38-
throw new Error(`URL '${gatewayAndHash} does not support Trustless`)
38+
const errorMsg = `URL '${gatewayAndHash} does not support the following Trustless response types: [` +
39+
`${failedTests.join(', ')}]`
40+
41+
log.debug(errorMsg)
42+
throw new Error(errorMsg)
3943
}
4044
} catch (err) {
4145
log.error(err)

src/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ <h1 class='f3 fw2 montserrat aqua ttu ma0'>Public Gateways</h1>
5656
<div class="Status" title="Online status: is it possible to read data?" style="cursor: help">Online</div>
5757
<div class="Cors" title="Allows Cross-Origin Resource Sharing (CORS fetch)"><a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#The_HTTP_response_headers" target="_blank">CORS</a></div>
5858
<div class="Origin" title="Provides Origin Isolation (Subdomain Gateway)"><a href="https://docs.ipfs.io/how-to/address-ipfs-on-web/#subdomain-gateway" target="_blank">Origin</a></div>
59-
<div class="Trustless" title="Supports Trustless Gateway Specification"><a href="https://github.com/ipfs/specs/blob/main/http-gateways/TRUSTLESS_GATEWAY.md" target="_blank">Trustless</a></div>
59+
<div class="Trustless" title="Supports Trustless Gateway Specification"><a href="https://docs.ipfs.tech/reference/http/gateway/#trustless-verifiable-retrieval" target="_blank">Block/CAR</a></div>
6060
<div class="Flag">Country</div>
6161
<div class="Link">Hostname</div>
6262
<div class="Took">ΔT</div>

0 commit comments

Comments
 (0)