Skip to content

Commit bcb6e1f

Browse files
authored
feat: support unixfs dir-index-html listing (#576)
Fixes #342
1 parent b9d062e commit bcb6e1f

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"@helia/http": "^2.0.3",
4848
"@helia/interface": "^5.0.0",
4949
"@helia/routers": "^3.0.0",
50-
"@helia/verified-fetch": "^2.5.0",
50+
"@helia/verified-fetch": "^2.5.1",
5151
"@libp2p/crypto": "^5.0.11",
5252
"@libp2p/dcutr": "^2.0.18",
5353
"@libp2p/identify": "^3.0.18",

src/lib/get-verified-fetch.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { createHeliaHTTP } from '@helia/http'
66
import { type BlockBroker } from '@helia/interface'
77
import { httpGatewayRouting, delegatedHTTPRouting, libp2pRouting } from '@helia/routers'
88
import { createVerifiedFetch, type VerifiedFetch } from '@helia/verified-fetch'
9+
import { dirIndexHtmlPluginFactory } from '@helia/verified-fetch/plugins'
910
import { generateKeyPair } from '@libp2p/crypto/keys'
1011
import { dcutr } from '@libp2p/dcutr'
1112
import { identify, identifyPush } from '@libp2p/identify'
@@ -85,7 +86,7 @@ export async function getVerifiedFetch (config: ConfigDb, logger: ComponentLogge
8586
})
8687
}
8788

88-
return createVerifiedFetch(helia, { contentTypeParser, withServerTiming: true })
89+
return createVerifiedFetch(helia, { contentTypeParser, withServerTiming: true, plugins: [dirIndexHtmlPluginFactory] })
8990
}
9091

9192
type Libp2pDefaultsOptions = Pick<ConfigDb, 'routers' | 'enableWss' | 'enableWebTransport' | 'enableGatewayProviders'>

0 commit comments

Comments
 (0)