mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-10 15:32:38 -07:00
Don't decode http response content
This commit is contained in:
parent
c9436195f3
commit
b84888356f
1 changed files with 4 additions and 4 deletions
|
@ -149,17 +149,17 @@ class HTTPHandler(object):
|
|||
logger.warn(u"Failed to access uri endpoint %s. Status code %r" % (self.uri, response_status))
|
||||
return None
|
||||
|
||||
def _http_format_output(self, response_content, response_headers):
|
||||
def _http_format_output(self, response_content, response_headers):
|
||||
"""Formats the request response to the desired type"""
|
||||
try:
|
||||
if self.output_format == 'text':
|
||||
output = response_content.decode('utf-8', 'ignore')
|
||||
if self.output_format == 'dict':
|
||||
output = helpers.convert_xml_to_dict(response_content.decode('utf-8', 'ignore'))
|
||||
output = helpers.convert_xml_to_dict(response_content)
|
||||
elif self.output_format == 'json':
|
||||
output = helpers.convert_xml_to_json(response_content.decode('utf-8', 'ignore'))
|
||||
output = helpers.convert_xml_to_json(response_content)
|
||||
elif self.output_format == 'xml':
|
||||
output = helpers.parse_xml(response_content.decode('utf-8', 'ignore'))
|
||||
output = helpers.parse_xml(response_content)
|
||||
else:
|
||||
output = response_content
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue