mirror of
https://github.com/AgriciDaniel/claude-seo.git
synced 2026-11-25 07:30:08 +01:00
- fetch_page.py read the whole body into memory with gzip accepted and no size limit, so a small compressed response could inflate without bound. It now streams inside the pinned session and stops past 10 MiB of decompressed bytes (MAX_PAGE_BYTES), keeps the part read, sets too_large, and reports it in the --json render_diagnostics. Bytes are decoded with url_safety.decode_body, the streamed twin of the shared decoder. - The chunk loop moves from sitemap_discovery._bounded_fetch into url_safety.read_bounded so both callers share it. _bounded_fetch keeps its name, signature and results. - capture_screenshot.py checked its output folder with a string prefix, so /home/user2 passed for /home/user, and a symlinked home never matched a resolved path. safe_output_dir() now resolves the output and both roots and compares with os.path.commonpath (a different Windows drive counts as outside); main() creates and writes into the resolved folder. - hooks/hooks.json: the PostToolUse schema hook gets "timeout": 30 (seconds) instead of the 10 minute default. Verified: fetch_page against a local gzip bomb (65 KB on the wire, 64 MiB inflated) now returns 10 MiB with too_large true; before it returned all 64 MiB. claude plugin validate output is unchanged by the hook timeout. New tests: test_fetch_page_size_cap.py (4), test_capture_screenshot_paths.py (5), plus the timeout assertion in test_cross_platform_hooks.py. Gates: pytest 3.10 and 3.14 green, ruff clean, consistency 0 errors, portability ok. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 2edd651c0fee399bd0a4aada1a12697dce13e5ad) (cherry picked from commit f0ef99b08dbcebdf8079e29b0469169690fb389d)
22 lines
443 B
JSON
22 lines
443 B
JSON
{
|
|
"hooks": {
|
|
"PostToolUse": [
|
|
{
|
|
"matcher": "Edit|Write",
|
|
"hooks": [
|
|
{
|
|
"type": "command",
|
|
"command": "node",
|
|
"args": [
|
|
"${CLAUDE_PLUGIN_ROOT}/hooks/run-python-hook.js",
|
|
"${CLAUDE_PLUGIN_ROOT}/hooks/validate-schema.py",
|
|
"${tool_input.file_path}"
|
|
],
|
|
"timeout": 30
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|