You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As an API designer and Oak user, I was looking for the HTTP Range header support in Oak and was pleased to see it is actually supported... with some limitation: it can only accept bytes ranges, as cruelly written in the parseRange function in range.ts:
However the RFC is a bit less limiting on this particular subject (see https://datatracker.ietf.org/doc/html/rfc9110/#section-14.1) as it notes "Range units are intended to be extensible".
I often use "items" and "pages" units myself for example.
I'm not a particularly talented Typescript developer but it doesn't seem to be such a big deal to implement and if we could agree on the approach, I could surely help.
We could introduce a GenericRange interface that ByteRange could extend, and update parseRange to return either GenericRange[] or ByteRange[], using the same condition you used to throw the exception. The rest of the code could be left untouched, to start.
Thank you for reading!
The text was updated successfully, but these errors were encountered:
Hi all!
This is a feature request.
As an API designer and Oak user, I was looking for the HTTP Range header support in Oak and was pleased to see it is actually supported... with some limitation: it can only accept bytes ranges, as cruelly written in the
parseRange
function inrange.ts
:However the RFC is a bit less limiting on this particular subject (see https://datatracker.ietf.org/doc/html/rfc9110/#section-14.1) as it notes "Range units are intended to be extensible".
I often use "items" and "pages" units myself for example.
I'm not a particularly talented Typescript developer but it doesn't seem to be such a big deal to implement and if we could agree on the approach, I could surely help.
We could introduce a
GenericRange
interface thatByteRange
could extend, and updateparseRange
to return eitherGenericRange[]
orByteRange[]
, using the same condition you used to throw the exception. The rest of the code could be left untouched, to start.Thank you for reading!
The text was updated successfully, but these errors were encountered: