test: include response body in non-JSON HTTP error msg
What changed, and why it matters
This is a tiny test-only change that adds the server's response text to an error message shown when a Bitcoin Core functional test receives an unexpected non-JSON HTTP response. It only affects the test framework's debugging output and does not change production Bitcoin Core code, network behavior, or security boundaries.
No security action needed; this is a benign test-framework logging improvement.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit modifies test/functional/test_framework/authproxy.py so that when an RPC call returns a non-JSON HTTP response, the raised JSONRPCException includes the response body in its message string. The change is one line: replacing a formatted message with an f-string that appends http_response.read().decode(). This is purely a diagnostic improvement for the functional test suite.
Changed components
test/functional/test_framework/authproxy.pyInspect captured patch +1 / −1
diff --git a/test/functional/test_framework/authproxy.py b/test/functional/test_framework/authproxy.py
index 2d2c42b3..a3eb0b05 100644
--- a/test/functional/test_framework/authproxy.py
+++ b/test/functional/test_framework/authproxy.py
@@ -191,7 +191,7 @@ class AuthServiceProxy():
content_type = http_response.getheader('Content-Type')
if content_type != 'application/json':
raise JSONRPCException(
- {'code': -342, 'message': 'non-JSON HTTP response with \'%i %s\' from server' % (http_response.status, http_response.reason)},
+ {'code': -342, 'message': f"non-JSON HTTP response with \'{http_response.status} {http_response.reason}\' from server: {http_response.read().decode()}"},
http_response.status)
data = http_response.read()
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.