ipfs / helia-verified-fetch

A fetch-like API for obtaining verified & trustless IPFS CIDs on the web
https://npmjs.com/package/@helia/verified-fetch
Other
11 stars 1 forks source link

bug: requests for identity CID is not being handled properly anymore #48

Closed SgtPooki closed 2 months ago

SgtPooki commented 2 months ago

https://github.com/ipfs-shipyard/service-worker-gateway/pull/187

When I request an identity CID from running service-worker-gateway locally I get application/octet-stream as content-type:

var r = await fetch('/ipfs/bafkqablimvwgy3y')
common.js:113 helia:service-worker-gateway helia-sw: incoming request url: http://localhost:3000/ipfs/bafkqablimvwgy3y: +2m
common.js:113 helia:service-worker-gateway helia-sw: request range header value: "null" +1ms
common.js:113 helia:service-worker-gateway helia-ws: cached response MISS for http://localhost:3000/ipfs/bafkqablimvwgy3y-*/* +0ms
common.js:113 helia:service-worker-gateway verifiedFetch for  +1ms http://localhost:3000/ipfs/bafkqablimvwgy3y
common.js:113 helia:verified-fetch fetch http://localhost:3000/ipfs/bafkqablimvwgy3y +2m
common.js:113 helia:verified-fetch:get-resolved-accept-header incoming accept header "*/*" +0ms
common.js:113 helia:verified-fetch:get-resolved-accept-header no explicit IPLD content-type requested, returning incoming accept header */* +0ms
common.js:113 helia:verified-fetch output type application/octet-stream +1ms
common.js:113 helia:verified-fetch:trace finding handler for cid code "85" and output type "application/octet-stream" +2m
common.js:113 helia:verified-fetch:trace calling handler "handleRaw" +0ms
common.js:113 helia:verified-fetch:byte-range-context:trace no range request detected +0ms
common.js:113 helia:verified-fetch:byte-range-context:trace set _fileSize to 5 +0ms
common.js:113 helia:verified-fetch:byte-range-context:trace requestRangeStart and requestRangeEnd are null +0ms
common.js:113 helia:verified-fetch:byte-range-context:trace set request body with fileSize 5 +1ms
common.js:113 helia:verified-fetch:byte-range-context:trace returning body unmodified for non-range, or invalid range, request +0ms
common.js:113 helia:service-worker-gateway helia-sw: response status: 200 +3ms
common.js:113 helia:service-worker-gateway helia-ws: storing response for key http://localhost:3000/ipfs/bafkqablimvwgy3y-*/* in cache +1ms

r.headers.get('content-type') // 'application/octet-stream'