feat: require content-type parser to set content-type
Description
adds contentTypeParser function to createVerifiedFetch options & implements it.
renamed getStreamAndContentType to getStreamFromAsyncIterable that now returns a stream with the firstChunk seen, so we can pass it to the contentTypeParser function.
updates tests in packages/verified-fetch & packages/interop
We may wish to also pass the file name to contentTypeParser if it's available? This way if it's passed index.html it can just use the extension to return text/html instead of nothing.
Title
feat: require content-type parser to set content-type
Description
contentTypeParser
function to createVerifiedFetch options & implements it.getStreamAndContentType
togetStreamFromAsyncIterable
that now returns a stream with the firstChunk seen, so we can pass it to thecontentTypeParser
function.Related https://github.com/ipfs/helia/pull/416 Fixes https://github.com/ipfs/helia/issues/422
Notes & open questions
Change checklist