Skip to content

refactor(httputil): generalise range support via ServeCacheHit hooks#359

Merged
alecthomas merged 1 commit into
mainfrom
aat/generalise-range-support
Jun 25, 2026
Merged

refactor(httputil): generalise range support via ServeCacheHit hooks#359
alecthomas merged 1 commit into
mainfrom
aat/generalise-range-support

Conversation

@alecthomas

Copy link
Copy Markdown
Collaborator

Add a WithResponseDecorator option and a bytes-served return to
ServeCacheHit so endpoints needing custom headers or negotiation can
reuse the shared range/conditional machinery instead of reimplementing
206/416/304/412 handling.

Refactor the git snapshot and bundle serve paths onto it: both now
forward ConditionalOptions to Open and serve via ServeCacheHit,
deleting the bespoke range/conditional code and giving bundles range
support. Snapshot freshen metadata is injected through the decorator on
both full and ranged responses.

Drop the now-unused RangeOptions helper.

Add a WithResponseDecorator option and a bytes-served return to
ServeCacheHit so endpoints needing custom headers or negotiation can
reuse the shared range/conditional machinery instead of reimplementing
206/416/304/412 handling.

Refactor the git snapshot and bundle serve paths onto it: both now
forward ConditionalOptions to Open and serve via ServeCacheHit,
deleting the bespoke range/conditional code and giving bundles range
support. Snapshot freshen metadata is injected through the decorator on
both full and ranged responses.

Drop the now-unused RangeOptions helper.
@alecthomas alecthomas requested a review from a team as a code owner June 25, 2026 23:41
@alecthomas alecthomas requested review from stuartwdouglas and removed request for a team June 25, 2026 23:41
@alecthomas alecthomas enabled auto-merge (squash) June 25, 2026 23:41
@alecthomas alecthomas merged commit c2bb197 into main Jun 25, 2026
7 checks passed
@alecthomas alecthomas deleted the aat/generalise-range-support branch June 25, 2026 23:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant