rest: print also HTTP response reason in case of an error
What changed, and why it matters
This commit only changes an error message in a test file so that when a test fails, it prints the HTTP reason phrase (like 'Not Found') alongside the status code. It does not change any production code, user-facing behavior, or security logic.
No security action needed; this is a test-only diagnostic improvement.
Security signals we found
No strong security signals were identified.
Evidence from the diff
A single-line edit in test/functional/interface_rest.py improves assertion failure diagnostics by including resp.reason in the formatted error string. The production REST interface and response handling are unchanged.
Changed components
test/functional/interface_rest.pyInspect captured patch +1 / −1
diff --git a/test/functional/interface_rest.py b/test/functional/interface_rest.py
index 2e9617d0..f2792169 100755
--- a/test/functional/interface_rest.py
+++ b/test/functional/interface_rest.py
@@ -84,7 +84,7 @@ class RESTTest (BitcoinTestFramework):
conn.request('POST', rest_uri, body)
resp = conn.getresponse()
- assert resp.status == status, f"Expected: {status}, Got: {resp.status} - Response: {str(resp.read())}"
+ assert resp.status == status, f"Expected: {status}, Got: {resp.status} ({resp.reason}) - Response: {str(resp.read())}"
if ret_type == RetType.OBJ:
return resp
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.