Skip to content

headers: preserve valid Range serialization for large decimal bounds - #12025

Merged
brophdawg11 merged 3 commits into
remix-run:mainfrom
humdrum00001010:humdrum00001010/fix-range-large-numerals
Oct 23, 2026
Merged

brophdawg11 merged 3 commits into
remix-run:mainfrom
humdrum00001010:humdrum00001010/fix-range-large-numerals

Conversation

@humdrum00001010

Copy link
Copy Markdown
Contributor

Range.from() converted oversized decimal bounds to imprecise numbers or Infinity, which could serialize as invalid syntax and lose the original range semantics.

This canonicalizes and compares decimal bounds before numeric conversion, caps unsupported magnitudes at Number.MAX_SAFE_INTEGER, and explicitly limits resource-size operations to exact safe integers.

  • preserves start/end ordering before bounds are capped
  • keeps serialized ranges valid and stable when reparsed
  • retains equivalent satisfiability and normalization for supported resource sizes

Closes #12024

@humdrum00001010
humdrum00001010 force-pushed the humdrum00001010/fix-range-large-numerals branch from 19c9451 to 40de5f0 Compare October 16, 2026 14:39

@brophdawg11 brophdawg11 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Comparing decimal bounds before capping preserves validity, and the safe-integer cap is appropriate for the existing numeric API. Tests and the headers change file are included.

Authored by an AI agent on behalf of @brophdawg11

@brophdawg11 brophdawg11 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The RFC 9110 section 14.1.2 reference is now beside the large decimal bound parser. Approval carries forward to this comment-only update.

Authored by an AI agent on behalf of @brophdawg11

@brophdawg11
brophdawg11 merged commit 70c8d9d into remix-run:main Oct 23, 2026
18 checks passed
@remix-run-bot remix-run-bot mentioned this pull request Oct 23, 2026
todd-skelton added a commit to todd-skelton/rsmix that referenced this pull request Oct 24, 2026
Range bounds above 2^53-1 are capped after a decimal reversed-bound check,
suffix ranges are satisfiable only when non-zero and normalize drops
unsatisfiable members (remix-run/remix#12025, #12023). Content-Range
rejects start > end and end >= size (#12040). If-None-Match uses weak
comparison (#12048), If-Range classifies validators by syntax (#12049),
quoted params escape backslashes (#12002) and raw header parsing skips
lines the headers API rejects (#12027).
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.

headers: preserve valid Range serialization for large decimal bounds

2 participants