Skip to content

mitmweb: support float options in the Options editor - #8447

Merged
lups2000 merged 1 commit into
mitmproxy:mainfrom
juliosuas:cursor/mitmweb-float-options-29bf
Oct 1, 2026
Merged

lups2000 merged 1 commit into
mitmproxy:mainfrom
juliosuas:cursor/mitmweb-float-options-29bf

Conversation

@juliosuas

Copy link
Copy Markdown
Contributor

Description

mitmweb's Options modal throws unknown option type float for addon options whose typespec is float. optmanager.dump_dicts already serializes that typespec as "float" via typespec_to_str, but the web client had no handler for it.

This adds a float number input (step="any", parseFloat), matching the existing int input. Invalid input parses to NaN, the same as parseInt on the int input. OptionMeta.type is already a string and the modal renders through Options[type], so no other UI or type changes are needed.

The change is web-only. The console-side float handling discussed in #4926 / #4927 is untouched.

Fixes #3144

Checklist

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

Testing

cd web && npm test (eslint, tsc --noEmit, Jest): 82 suites, 340 tests passing.

AI-assisted; reviewed and tested by me.

@lups2000 lups2000 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.

Thanks for taking care of this! LGTM 🚀

@lups2000

lups2000 commented Oct 1, 2026

Copy link
Copy Markdown
Member

Can you rerun the jobs with the latest change in #8458 ?

Addon options with typespec float are sent to mitmweb as type "float"
but the Options modal had no handler for it and threw
"unknown option type float". Add a number input with step="any" that
parses with parseFloat, matching the int input.

Fixes mitmproxy#3144
@cursor
cursor Bot force-pushed the cursor/mitmweb-float-options-29bf branch from 977d2c2 to fe2c328 Compare October 1, 2026 06:25
@lups2000
lups2000 merged commit 3a5deb0 into mitmproxy:main Oct 1, 2026
28 checks passed
lups2000 pushed a commit to lups2000/mitmproxy that referenced this pull request Oct 31, 2026
Addon options with typespec float are sent to mitmweb as type "float"
but the Options modal had no handler for it and threw
"unknown option type float". Add a number input with step="any" that
parses with parseFloat, matching the int input.

Fixes mitmproxy#3144

Co-authored-by: Julio César Suástegui <[email protected]>
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.

mitmweb - Does not support same addon options types as mitmproxy

2 participants