fix(runner): return error when -fpt filter fails to initialize#2496
fix(runner): return error when -fpt filter fails to initialize#2496singhvishalkr wants to merge 1 commit into
Conversation
When users specify -fpt (filter-page-type) flag, the dit classifier must be successfully initialized. Previously, if the dit model was missing, httpx would only log a warning and silently fail to apply the filter, causing unexpected behavior where error pages would not be filtered as expected. This change returns a descriptive error when the classifier cannot be initialized for -fpt usage, guiding users to run 'dit data download' to install the required model. Fixes projectdiscovery#2495 Co-authored-by: Cursor <cursoragent@cursor.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Thanks for the attempt, but this doesn't actually fix #2495. The reported bug is that The real fix needs to live in the |
Summary
Changes
Proof
Before (silent failure):
\
httpx -u jsdk.baidu.com -fpt error
https://jsdk.baidu.com # Error page NOT filtered
\\
After (clear error):
\
httpx -u jsdk.baidu.com -fpt error
FATAL: could not initialize page classifier for -fpt filter: dit: model.json not found (run 'dit data download' to install the model)
\\
Checklist
/claim #2495