Flowlight 0.13.0 - #24
Merged
Merged
Conversation
… answer A new RewriteRule edits a matching request on its way out — set/add/remove a header, or set/remove a field in the JSON body by dotted key path (a value that is valid JSON is used as-is, otherwise taken as text) — and lets it continue to the server. Matched like a mock (host, path glob, method). It needs no proxy change: the .replace intervention path that guardrails use to forward a modified request already carries it. The rewrite is composed into the interventions closure after the guardrail branch — guardrails strip refused tools first, then the user's edits apply — and shouldInspect decrypts a host a rule names, like it does for mocks. Headers are sanitised and Content-Length is reframed so the request stays well-formed. Rules live in UserDefaults and a "Modify requests" section on the Inspect screen edits them. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Version bump, release notes for request rewriting, and the rebuilt site. Extension stays pinned at 0.10.1 — no reboot to upgrade. Co-Authored-By: Claude Opus 4.8 <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.
Rewrite outgoing requests with rules — the mock feature's sibling: where a mock answers a request, this edits it and forwards it.
What's in it
RewriteRule— matches like a mock (host / path glob / method) and edits the request: header ops (set/add/remove) and JSON-body ops (set/remove by dotted key path; value parsed as JSON or taken as text). Pure, tested logic with header sanitization and correctContent-Lengthreframing..replaceintervention path guardrails use. Composed intoInspectionController.interventionsafter the guardrail branch (guardrails strip tools first, then the user's edits apply);shouldInspectdecrypts a host a rule names, like mocks. Rules persist in UserDefaults, untouched by "remove recorded data".Extension stays pinned at 0.10.1 — no reboot to upgrade.
Tests
613 pass, incl. 12 new
RewriteRuleTests(header set/add/remove, JSON set/remove/nested, scalar-vs-string value parsing, Content-Length agrees with the rewritten body, header-injection sanitization, non-match, no-op, forward-compatible decode).🤖 Generated with Claude Code