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
19 stars 5 forks source link

feat: support http range header #10

Closed SgtPooki closed 8 months ago

SgtPooki commented 8 months ago

Title

Add Range header support.

Description

Fixes https://github.com/ipfs/helia-verified-fetch/issues/9

Notes & open questions

Change checklist

SgtPooki commented 8 months ago

On mobile but wanted to give a shout that ive got a refactor going that cleans this up a bunch

achingbrain commented 8 months ago

ive got a refactor going that cleans this up a bunch

Done a first pass, will look again after the refactor lands.

SgtPooki commented 8 months ago

FYI: some tests were failing when merging main into byte-range PR due to new ipns things. changes at acdd632 (#10)

SgtPooki commented 8 months ago

commenting elsewhere since the thread (https://github.com/ipfs/helia-verified-fetch/pull/10#discussion_r1521644018) was collapsed:

we could solve both concerns by setting internalFileSize so we know which value we set vs consumers.. but that could get confusing. i'll leave as is for now.

i've got _isRangeRequest updated locally, and have isValidRangeRequest updated as well.

So now we have:

inaccessable properties outside the ByteRangeContext class:

  1. _fileSize // setter and getter set/get methods. see 8837738 (#10)
  2. _contentRangeHeaderValue // getter (depends on other operations) see 314adca (#10)
  3. _body // set/get methods
  4. _isValidRangeRequest // getter (depends on other operations) see d633456 (#10)

the only outlier here seems to be _body having setBody and getBody methods

github-actions[bot] commented 8 months ago

:tada: This PR is included in version 1.2.0 :tada:

The release is available on npm package (@latest dist-tag)

Your semantic-release bot :package::rocket:

github-actions[bot] commented 8 months ago

:tada: This PR is included in version 1.7.0 :tada:

The release is available on npm package (@latest dist-tag)

Your semantic-release bot :package::rocket:

github-actions[bot] commented 6 months ago

:tada: This PR is included in version 1.0.0 :tada:

The release is available on npm package (@latest dist-tag)

Your semantic-release bot :package::rocket:

github-actions[bot] commented 1 month ago

:tada: This PR is included in version 1.0.0 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: