Skip to content

Commit

Permalink
devel/py-python-bugzilla: Fix for API key leak
Browse files Browse the repository at this point in the history
Fixes python-bugzilla/python-bugzilla#187

PR:		278612
MFH:		2024Q2
Pull Request:	#253

(cherry picked from commit e199513)
  • Loading branch information
ricardobranco777 authored and lwhsu committed Apr 29, 2024
1 parent ab48099 commit 188a62c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions devel/py-python-bugzilla/Makefile
@@ -1,5 +1,6 @@
PORTNAME= python-bugzilla
PORTVERSION= 3.2.0
PORTREVISION= 1
CATEGORIES= devel python
MASTER_SITES= PYPI
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
Expand Down
23 changes: 23 additions & 0 deletions devel/py-python-bugzilla/files/patch-bugzilla___session.py
@@ -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

0 comments on commit 188a62c

Please sign in to comment.