Skip to content
Prev Previous commit
Next Next commit
Display query in the URL on failed request
Signed-off-by: Emmanuel Ferdman <emmanuelferdman@gmail.com>
  • Loading branch information
emmanuel-ferdman committed Apr 25, 2025
commit 0442b848e50d1eb4288226b7e207fe9c57c57c64
2 changes: 1 addition & 1 deletion src/hackingBuddyGPT/capabilities/http_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def __call__(
allow_redirects=self.follow_redirects,
)
except requests.exceptions.RequestException as e:
url = self.host + ("" if path.startswith("/") else "/") + path + ("?{query}" if query else "")
url = self.host + ("" if path.startswith("/") else "/") + path + (f"?{query}" if query else "")
return f"Could not request '{url}': {e}"

response_headers = "\r\n".join(f"{k}: {v}" for k, v in resp.headers.items())
Expand Down