FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Validate mitmweb flow filters on the backend by lups2000 · Pull Request #8331 · mitmproxy/mitmproxy · GitHub

Validate mitmweb flow filters on the backend - #8331

Open
lups2000 wants to merge 7 commits into
mitmproxy:mainfrom
lups2000:filters-validation-mitmweb
Open

Validate mitmweb flow filters on the backend#8331
lups2000 wants to merge 7 commits into
mitmproxy:mainfrom
lups2000:filters-validation-mitmweb

Conversation

lups2000 commented Jul 18, 2026
edited
Loading

Copy link
Copy Markdown
Member

Description

This PR moves mitmweb flow-filter validation (search/highlight/intercept) from the frontend to the backend, making mitmproxy.flowfilter the single source of truth for filter parsing.

This adds a GET /filter/validate?expression=... endpoint that returns either the parsed filter description or a validation error.

The filter input now:

  • validates filters through the backend;
  • waits 300ms after typing before sending a request;
  • cancels obsolete requests and ignores stale responses;
  • only propagates filters after successful validation;
  • displays backend validation and request errors.

The obsolete frontend flow-filter parser (filt.js and filt.peg) has been removed.

Note

For a valid expression, flowfilter.parse() is called twice: once by the validation endpoint and again when the filter is applied by Search, Highlight, or Intercept.

This is intentional. The validation request and the operation applying the filter are independent, and the second parse keeps the existing backend paths authoritative without sharing parser objects or introducing a cache. The additional cost should be negligible.

It closes also: #8239

Checklist

  • I have updated tests where applicable.
  • I have added an entry to the CHANGELOG.

lups2000 requested a review from mhils July 18, 2026 10:02

mhils left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

-2800 🥳🥳🥳

Comment thread mitmproxy/tools/web/app.py Outdated
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL