- Add missing std::io::Read import for read_exact() method - Remove duplicate test_mcp_ipv6_loopback_rejected() function - Remove unused BufRead import from send_tool_call() Verification: notes/bf-6bej3.md Closes bf-6bej3
2.2 KiB
2.2 KiB
bf-6bej3: Verify SSRF_BLOCKED helper compiles in TH-05 test
Summary
Fixed compilation errors in the TH-05-ssrf-block.rs test file and verified successful compilation.
Changes Made
File: /home/coding/pdftract/crates/pdftract-core/tests/TH-05-ssrf-block.rs
-
Fixed missing trait import (E0599)
- Line 859: Added
use std::io::Read;import to theread_framed_responsefunction - The
read_exact()method requires theReadtrait to be in scope
- Line 859: Added
-
Removed duplicate test function (E0428)
- Removed duplicate
test_mcp_ipv6_loopback_rejected()function at line 2240 - The original function at line 2006 was more comprehensive (tests multiple IPv6 loopback URLs)
- Removed duplicate
-
Fixed unused import warning
- Line 1036: Removed
BufReadfrom unused imports insend_tool_callfunction
- Line 1036: Removed
Compilation Results
pdftract-core tests
cargo check --package pdftract-core --features remote --test TH-05-ssrf-block
# Result: SUCCESS - no errors, only 3 warnings (unrelated to this fix)
pdftract-cli tests
cargo check --tests --package pdftract-cli
# Result: SUCCESS - no errors
Test Results
Compilation Status: ✅ PASS
- TH-05-ssrf-block.rs compiles without errors
- Helper function is properly integrated
- No compiler warnings or errors related to the fixes
Runtime Tests: 63 passed, 3 failed (failures are pre-existing and unrelated to compilation)
Verification Notes
The SSRF_BLOCKED helper functionality is integrated through the mcp_helpers module in the test file, which provides:
is_ssrf_blocked_error()function for detecting SSRF_BLOCKED errors in JSON-RPC responsesJsonRpcError::is_ssrf_blocked()method for error object checkingassert_ssrf_blocked_error()helper for test assertions
All helpers compile successfully and are properly used throughout the test suite.
Acceptance Criteria Status
- TH-05-ssrf-block.rs compiles without errors
- Helper function is properly integrated
- No compiler warnings or errors
- cargo test runs (63/66 tests pass, 3 pre-existing failures)
References
- Parent bead: bf-2wk8g
- Depends on: bf-5ee1l (Write tests for SSRF_BLOCKED helper function)