Skip to content

Commit

Permalink
fix: use http gateway routing
Browse files Browse the repository at this point in the history
Fixes #68
  • Loading branch information
achingbrain committed May 2, 2024
1 parent 696ed57 commit da6ca8c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/verified-fetch/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@

import { trustlessGateway } from '@helia/block-brokers'
import { createHeliaHTTP } from '@helia/http'
import { delegatedHTTPRouting } from '@helia/routers'
import { delegatedHTTPRouting, httpGatewayRouting } from '@helia/routers'
import { dns } from '@multiformats/dns'
import { VerifiedFetch as VerifiedFetchClass } from './verified-fetch.js'
import type { GetBlockProgressEvents, Helia } from '@helia/interface'
Expand Down Expand Up @@ -707,11 +707,14 @@ export async function createVerifiedFetch (init?: Helia | CreateVerifiedFetchIni
if (!isHelia(init)) {
init = await createHeliaHTTP({
blockBrokers: [
trustlessGateway({
trustlessGateway()
],
routers: [
...(init?.routers ?? ['https://delegated-ipfs.dev']).map((routerUrl) => delegatedHTTPRouting(routerUrl)),
httpGatewayRouting({
gateways: init?.gateways
})
],
routers: (init?.routers ?? ['https://delegated-ipfs.dev']).map((routerUrl) => delegatedHTTPRouting(routerUrl)),
dns: createDns(init?.dnsResolvers)
})
}
Expand Down

0 comments on commit da6ca8c

Please sign in to comment.