Repository navigation
FIX HTTP targets store decoded response text and JSON keys may contain digits or hyphens - #2814
Merged
hannahwestra25 merged 12 commits intoSep 29, 2026
Merged
Conversation
…n digits or hyphens
…k4rs6/PyRIT into fix/http-target-response-text
hannahwestra25
approved these changes
Sep 28, 2026
hannahwestra25
left a comment
Contributor
There was a problem hiding this comment.
thanks for contributing!
hannahwestra25
enabled auto-merge
September 28, 2026 20:52
hannahwestra25
disabled auto-merge
September 28, 2026 21:56
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Sep 29, 2026
Contributor
Author
|
The merge queue run failed on one Windows test, tests/unit/infra/test_code_deployment.py::TestCodeDeployment::test_cancellation_keeps_public_access_disabled_until_connection_removal, where the bash subprocess timed out after 30s. This PR doesn't touch infra, and that test passed on the PR's own checks, so it looks like a runner flake. Could you requeue it? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2813.
Both HTTP targets now store
response.text(callback results are untouched), and the regex callback searchesresponse.textand falls back to it._fetch_keytakes any run of characters other than.,[and]as a key segment, sooutput2,generated-textandv2_answerwork. Index syntax is the same. The callback type hints now sayhttpx.Response, which is what the targets actually pass.Tests: new cases for non-ASCII and multi-line bodies, keys with digits and hyphens, and both targets storing decoded text with no callback (all 9 fail on main). I updated
test_parse_regex_response_no_match, which was asserting theb'...'output, and switched a few mocks to realhttpx.Responseobjects since the code reads.textnow.tests/unit/prompt_target: 1352 passed.