[ENG-4059] Resolve request fields the way applications read them - #304
Merged
Merged
Conversation
|
Well-commented and cohesive enhancements to request parsing and normalization. 🎯 Quality: 95% Elite · 📦 Size: Extra Large — strongly consider breaking this down 🛡️ Standards: Not checked — 631 lines changed, over your team's 400-line limit, and nothing checked before it was opened. Coding agents can call the 🤖 Authorship: Agent-written — Claude Code, going by its own attribution. Whether a person read it is unknown; coding agents can call the 📈 This month: Your 161st PR — above team average · Averaging Good |
patchstackdave
force-pushed
the
fix/request-field-shapes
branch
from
September 28, 2026 14:46
7267294 to
d01cc6f
Compare
Cookie values are split before they are normalised, and normalised the same way whether a framework parsed them or they come from the header. Quoted values lose their quotes, and a repeated name keeps every value. Field paths resolve in both spellings a form or query field can take: nested (`user.name`, `id`) and bracketed (`user[name]`, `id[]`), whichever parser produced the request. A structured value too large for the leaf walk is matched as serialised text beyond the walk's bound, and the bound is reported as a `container-cap` coverage skip. `internal_host` reads the host from the shorter URL spellings a URL parser still resolves (`http:/host`, `http:host`, backslashes, tabs and leading controls). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A decoding mutation applied to a structured value keeps any node past its node or depth bound undecoded. That is now reported as the same `container-cap` skip the leaf walk reports, so a value that reaches a whole-value matcher past the bound is visible in `onSkip` and `coverage()` instead of being matched undecoded without notice. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
patchstackdave
force-pushed
the
fix/request-field-shapes
branch
from
September 28, 2026 15:04
d01cc6f to
6bc268b
Compare
patchstackdave
added this pull request to stack #318
September 29, 2026 08:03
Contributor
Author
|
/review |
mariojgt
approved these changes
Sep 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #298 (request value decoding), which should merge first.
Makes a rule see a request field in the same form the application reads it, whichever parser produced the request, and reports when a value is too large to inspect in full.
Cookieheader. Quoted values lose their quotes, and a name sent more than once keeps every value, so a rule inspects each one.get.user.namealso resolvesuser[name], andget.idalso resolvesid[]. The reverse works too, so a rule written in either spelling applies both to parsers that expand brackets and to parsers that keep them as literal keys. Therequest.*source follows the same rule.container-capskip throughonSkip/coverage(). This applies to the request phase and, once per response, to the response phase. A decoding mutation that reaches its own node or depth bound on a structured value reports the same skip, so a value handed to a whole-value matcher past that bound is visible too.internal_host. The host is also read from the shorter URL spellings a URL parser still resolves:http:/host,http:host, backslash forms, and tabs or leading control characters.Synthetic tests cover each shape, including its fetch, Node and Express paths, with controls that must not match.
Validation: full suite with #298 (3,501 passed, 7 skipped), typecheck and build.
🤖 Generated with Claude Code