Skip to content

Add 'header-includes' matcher & matchReplaceHeaders transform (local mockttp 4.4.2)#229

Closed
komen205 wants to merge 2 commits into
httptoolkit:mainfrom
komen205:header-includes-matcher
Closed

Add 'header-includes' matcher & matchReplaceHeaders transform (local mockttp 4.4.2)#229
komen205 wants to merge 2 commits into
httptoolkit:mainfrom
komen205:header-includes-matcher

Conversation

@komen205

Copy link
Copy Markdown
Contributor

Summary

Server-side support for substring header matching and header-value match-and-replace, the counterpart to the corresponding httptoolkit-ui PR.

This repoints the dependency onto a locally-built mockttp 4.4.2 that adds:

  • a header-includes matcher — matches when a given header's value contains a substring, evaluated server-side like every other matcher (rather than via a UI-side callback). This removes the per-request round-trip and the requirement for the UI to stay connected for matching to work.
  • a matchReplaceHeaders transform — rewrites patterns within a header's value without replacing the whole header (e.g. one cookie inside a multi-cookie Cookie header).

Changes

  • package.json / package-lock.json — point mockttp at the local 4.4.2 build carrying the new matcher + transform.
  • overrides/js/package.json — matching override bump.

Notes

  • This is a draft: it depends on the local mockttp build and isn't directly mergeable until that mockttp change is released. Opening it for visibility alongside the UI PR and for feedback on the matcher/transform design.

komen205 and others added 2 commits June 11, 2026 16:44
Temporary dependency on a locally-built mockttp 4.4.2 including the new
'header-includes' matcher (withHeadersIncluding), until that's released
upstream. No code changes needed: rule deserialization & matching all
happens inside mockttp itself.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatednpm/​mockttp@​4.4.1 ⏵ 4.4.200000

View full report

@komen205

Copy link
Copy Markdown
Contributor Author

Closing — not needed.

@komen205 komen205 closed this Jun 23, 2026
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.

1 participant