Skip to content

Commit

Permalink
fix: Graylog may respond empty content
Browse files Browse the repository at this point in the history
  • Loading branch information
cdumay committed Oct 23, 2019
1 parent b613413 commit 8b4a794
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
0.1.2
0.1.3
12 changes: 11 additions & 1 deletion src/flask_graylog_bundle/server.py
Expand Up @@ -15,11 +15,21 @@
logger = logging.getLogger(__name__)


class ForgetResponseClient(RESTClient):
# noinspection PyMethodMayBeStatic
def _parse_response(self, response):
# noinspection PyBroadException
try:
return response.json()
except Exception:
pass


class GraylogAPIServer(GraylogExt):
@property
def client(self):
if self._client is None:
self._client = RESTClient(
self._client = ForgetResponseClient(
server=self.app.config['GRAYLOG_API_URL'],
username=self.app.config['GRAYLOG_API_USERNAME'],
password=self.app.config['GRAYLOG_API_PASSWORD'],
Expand Down

0 comments on commit 8b4a794

Please sign in to comment.