Skip to content

headers: classify If-Range validators by syntax - #12049

Merged
brophdawg11 merged 5 commits into
remix-run:mainfrom
humdrum00001010:humdrum00001010/fix-if-range-validator-type
Oct 23, 2026
Merged

brophdawg11 merged 5 commits into
remix-run:mainfrom
humdrum00001010:humdrum00001010/fix-if-range-validator-type

Conversation

@humdrum00001010

Copy link
Copy Markdown
Contributor

IfRange.matches() currently conflates absent and explicitly empty fields, lets HTTP dates fall through to ETag comparison, and normalizes malformed bare values into entity tags.

Track field presence through construction and mutation, classify only valid HTTP dates or quoted strong entity tags, and keep SuperHeaders native storage and typed values synchronized across empty mutations.

Closes #12042

humdrum00001010 and others added 5 commits October 18, 2026 20:44
Keep empty values matching unconditionally and retain the enumerable value field. Remove copying support and presence tracking so the fix stays focused on date and entity-tag comparison.
@brophdawg11

Copy link
Copy Markdown
Contributor

Pushed 3677d3f to keep this fix focused on validator classification: HTTP dates compare only against Last-Modified, valid quoted strong ETags compare only against ETag, and malformed nonempty values fail the condition.

The update preserves the existing public API and empty-value behavior. Empty and absent values still match unconditionally, .value remains an enumerable public field, and the constructor and from() retain their existing input types. Distinguishing explicitly empty input from absence would require additional state tracking and mutation semantics; copying support adds a separate API capability. Those can be considered separately. The explicitly empty-input part of #12042 is therefore intentionally left unchanged.

The regression tests cover empty input, subsequent mutation, SuperHeaders synchronization, partial responses for an empty condition, and field enumeration. The spec links remain, and the README and change file reflect the narrower scope.

All 458 headers tests and 202 response tests passed, along with both package typechecks, formatting, and release preview. Local lint remains blocked by the nested worktree inheriting the parent checkout's options.typeAware configuration.

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.

Looks good. The fix classifies If-Range validators before comparison, using Last-Modified for HTTP dates and exact strong ETag comparison for quoted tags. Malformed nonempty values fail the condition. Existing empty/absent behavior, the enumerable value field, and constructor/from input types are preserved. Regression tests, spec links, README, and the change file reflect that scope. All 458 headers tests, 202 response tests, both package typechecks, formatting, and release preview passed locally; CI lint has also passed.

Authored by an AI agent on behalf of @brophdawg11

@brophdawg11
brophdawg11 merged commit b32a88c into remix-run:main Oct 23, 2026
19 checks passed
@remix-run-bot remix-run-bot mentioned this pull request Oct 23, 2026
@humdrum00001010
humdrum00001010 deleted the humdrum00001010/fix-if-range-validator-type branch October 24, 2026 04:05
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: classify If-Range validators by syntax

2 participants