mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-16 02:02:58 -07:00
parent
b3f8341e0c
commit
f4eff8a8c5
1 changed files with 4 additions and 4 deletions
|
@ -635,9 +635,9 @@ General optional parameters:
|
||||||
cherrypy.response.headers['Content-Type'] = 'application/json;charset=UTF-8'
|
cherrypy.response.headers['Content-Type'] = 'application/json;charset=UTF-8'
|
||||||
try:
|
try:
|
||||||
if self._api_debug:
|
if self._api_debug:
|
||||||
out = json.dumps(out, indent=4, sort_keys=True, ensure_ascii=False).encode('utf-8')
|
out = json.dumps(out, indent=4, sort_keys=True, ensure_ascii=False)
|
||||||
else:
|
else:
|
||||||
out = json.dumps(out, ensure_ascii=False).encode('utf-8')
|
out = json.dumps(out, ensure_ascii=False)
|
||||||
if self._api_callback is not None:
|
if self._api_callback is not None:
|
||||||
cherrypy.response.headers['Content-Type'] = 'application/javascript'
|
cherrypy.response.headers['Content-Type'] = 'application/javascript'
|
||||||
# wrap with JSONP call if requested
|
# wrap with JSONP call if requested
|
||||||
|
@ -650,7 +650,7 @@ General optional parameters:
|
||||||
out['result'] = 'error'
|
out['result'] = 'error'
|
||||||
|
|
||||||
elif self._api_out_type == 'xml':
|
elif self._api_out_type == 'xml':
|
||||||
cherrypy.response.headers['Content-Type'] = 'application/xml'
|
cherrypy.response.headers['Content-Type'] = 'application/xml;charset=UTF-8'
|
||||||
try:
|
try:
|
||||||
out = xmltodict.unparse(out, pretty=True)
|
out = xmltodict.unparse(out, pretty=True)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
@ -671,7 +671,7 @@ General optional parameters:
|
||||||
</response>
|
</response>
|
||||||
''' % e
|
''' % e
|
||||||
|
|
||||||
return out
|
return out.encode('utf-8')
|
||||||
|
|
||||||
def _api_run(self, *args, **kwargs):
|
def _api_run(self, *args, **kwargs):
|
||||||
""" handles the stuff from the handler """
|
""" handles the stuff from the handler """
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue