Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
devel/py-python-bugzilla: Fix for API key leak
Fixes python-bugzilla/python-bugzilla#187 PR: 278612 MFH: 2024Q2 Pull Request: #253 (cherry picked from commit e199513)
- Loading branch information
1 parent
ab48099
commit 188a62c
Showing
2 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
23 changes: 23 additions & 0 deletions
23
devel/py-python-bugzilla/files/patch-bugzilla___session.py
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- bugzilla/_session.py | ||
+++ bugzilla/_session.py | ||
@@ -98,14 +98,14 @@ def request(self, *args, **kwargs): | ||
if "timeout" not in kwargs: | ||
kwargs["timeout"] = timeout | ||
|
||
- response = self._session.request(*args, **kwargs) | ||
+ try: | ||
+ response = self._session.request(*args, **kwargs) | ||
|
||
- if self._is_xmlrpc: | ||
- # Yes this still appears to matter for properly decoding unicode | ||
- # code points in bugzilla.redhat.com content | ||
- response.encoding = "UTF-8" | ||
+ if self._is_xmlrpc: | ||
+ # This still appears to matter for properly decoding unicode | ||
+ # code points in bugzilla.redhat.com content | ||
+ response.encoding = "UTF-8" | ||
|
||
- try: | ||
response.raise_for_status() | ||
except requests.HTTPError as e: | ||
# Scrape the api key out of the returned exception string |