Flowlight 0.13.1 - #28
Merged
Merged
Conversation
A request rule's body edit did nothing against a form POST. Reported with a "Set stockApi = http://localhost/admin"
rule that never fired: the request Chrome made was application/x-www-form-urlencoded —
stockApi=http%3A%2F%2Fstock.example.net%3A8080%2Fcheck
and the body edit was gated on the body parsing as a JSON object, so a form body fell through untouched. The
dialog said as much ("Only requests with a JSON body are changed"), which made it correct behaviour and a
useless feature for the most common kind of body there is.
So a body edit now also applies to a form body. When the body is not JSON and the request carries a
Content-Type of application/x-www-form-urlencoded, the path is a field name taken whole — a form is flat, so
`a.b` is a field literally named that, not a nested one — and the value is used as typed, because a form has
no types. Fields are parsed into ordered pairs that may repeat (set edits the first, remove drops all), and
re-encoded the way a browser does: + for space, everything else percent-encoded, so http://localhost/admin
goes on the wire as http%3A%2F%2Flocalhost%2Fadmin. Content-Length is reframed to match, as for JSON.
The Content-Type header is the signal: a body that merely looks like a form, with no such header, is still
left alone. JSON is tried first and is unchanged.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Rewrite rules now support application/x-www-form-urlencoded request bodies, so form fields can be set or removed before the request is forwarded. Preserve repeated fields and field order, re-encode values like a browser, and reframe Content-Length. Add form-body coverage and release metadata for 0.13.1. Co-Authored-By: Claude Code <noreply@anthropic.com>
This branch was successfully deployed
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.
0.13.1 — Form-body request rewriting
Request-modification rules now rewrite
application/x-www-form-urlencodedbodies as well as JSON:Content-Length.Includes six focused regression tests for encoding, appending, removal, repeated fields, missing Content-Type, and charset parameters. Locally verified with
RewriteRuleTests; generated site validates 52 pages / 0 problems.Release metadata is bumped to 0.13.1, release notes are added, and
docs/is regenerated. This PR is ready for the release sequence: CI → immutablev0.13.1tag → dry run → publish → merge.🤖 Generated with Claude Code