Repository navigation
fix: map the polite aggression level to a level WhatWeb accepts - #14
Uzair-Ahmed-Dahraj wants to merge 1 commit into
Conversation
WhatWeb 0.6.4 accepts only levels 1, 3 and 4, so each polite scan failed. server.json moves to 1.0.2 so that a new release tag is possible.
There was a problem hiding this comment.
Verified clean at head 5fb2776 (4 files, +18/-4). Repo has no CI, so this local run is the gate.
Aggression mapping verified against upstream source. WhatWeb v0.6.4 (the exact version the Dockerfile clones) raises "Agression level must be 1,3, or 4. #{arg} is invalid." for anything outside [1,3,4] — see https://github.com/urbanadventurer/WhatWeb/blob/v0.6.4/whatweb, option-parsing around -a/--aggression. So the old "polite": 2 made every polite scan die with a Ruby exception. The fix ("polite": 1) is correct, the inline comment explains it, and the remaining levels (stealthy:1, passive:1, normal:3, aggressive:4) are all valid. README mapping line updated to match.
Local test suite on this head: 25 passed, 0 failed, 2 warnings in 2.47s (Python 3.12.3, exact pins mcp 1.28.1 / pydantic 2.11.5 / pydantic-settings 2.9.1; the new tests/test_aggression.py contributes 5 parametrized cases). Note: pins do not resolve on Python ≥3.14 where mcp 1.28.1 requires pydantic ≥2.12 — environment quirk, not a PR defect.
Merge compatibility with #13 — git merge-tree pr/13 pr/14 exits 0, clean; README edits touch different lines (155 vs 162-163) and both land in the merged tree.
Deployment note (non-blocking, merge-order nuance): server.json now references docker.io/devkind/whatweb-mcp:1.0.2, but Docker Hub currently has only 1.0.0 and latest (same digest). Registry consumers will pull-fail until the 1.0.2 image is pushed — push the image before/with merge, same cadence as 1.0.0 in #12. .claude-plugin/plugin.json stays at 1.1.1, which tracks the plugin manifest separately; consistent with how #13 bumps its own URL field.
Problem
whatweb_scanoffers five aggression names. The namepolitemaps to WhatWeb level 2. WhatWeb 0.6.4, the version the Dockerfile pins, accepts only levels 1, 3 and 4:Source: line 505 of
whatwebat tag v0.6.4.Impact
Each scan with
aggression: "polite"fails. The tool schema listspoliteas a valid value, so an agent can select it.Fix
server.py:politemaps to level 1, the one-request level. The name stays in the schema, so a client that sendspolitekeeps working.tests/test_aggression.py: a test that each name maps to a level WhatWeb accepts.README.md: the level line now showsstealthy/passive/politeas level 1.server.json:versionand the image tag move from 1.0.1 to 1.0.2. Tagv1.0.1exists on an older commit, and the release workflow needs the tag to equalserver.json. A release of this fix needs tagv1.0.2.Example
whatweb_scanwithaggression: "polite"whatweb -a 2, which WhatWeb rejectswhatweb -a 1Verification
1 failed, on[polite]. With the fix:25 passed.jqonserver.json:versionis1.0.2and the identifier isdocker.io/devkind/whatweb-mcp:1.0.2.git apply --checkof the diff of docs: add a privacy policy for the plugin directory #13 passes on top of this branch, so the two pull requests do not conflict.Review Notes
.claude-plugin/plugin.jsonstays at 1.1.1. No plugin file changes here: the fix is in the server image.README.mdline 7 still says "five aggression levels". Five names exist, and three of them now give level 1. The line is not changed here.latestis still the 1.0.0 image. The fix reaches users only after a release, and the release needs theDOCKERHUB_USERNAMEandDOCKERHUB_TOKENrepository secrets.main, so the tests do not run on this pull request. They ran locally.