Harden protection with pinned requests and path-param encoding (#2486)

* Harden protection with pinned requests and path-param encoding

* fix: domain pinning

* fix: tests

* fix: html test 2

---------

Co-authored-by: Alex <a@tushynski.me>
This commit is contained in:
PavelandAlex authored and GitHub committed 2026-05-23 02:33:29 +01:00
1 parent 6cfdc4fbae
commit aaad51f951
20 files changed
+623 -723

No files matched your search

+4 -2
View File
@@ -581,11 +581,13 @@ class TestReadWebpageErrors:
from application.agents.tools.read_webpage import ReadWebpageTool
tool = ReadWebpageTool({})
with patch("application.agents.tools.read_webpage.requests.get") as mock_get:
with patch(
"application.agents.tools.read_webpage.pinned_request"
) as mock_pinned_request:
mock_response = MagicMock()
mock_response.raise_for_status.return_value = None
mock_response.text = "<html><body>test</body></html>"
mock_get.return_value = mock_response
mock_pinned_request.return_value = mock_response
with patch(
"application.agents.tools.read_webpage.markdownify",
side_effect=Exception("parse error"),