mirror of
https://github.com/moparisthebest/SickRage
synced 2024-12-13 03:22:22 -05:00
Fixed webapi jsonp response code
This commit is contained in:
parent
f13cffc24d
commit
71d95b463e
@ -162,10 +162,10 @@ class Api(webserve.MainHandler):
|
|||||||
return webserve._munge(t)
|
return webserve._munge(t)
|
||||||
|
|
||||||
def _out_as_json(self, dict):
|
def _out_as_json(self, dict):
|
||||||
self.set_header("Content-Type", "application/json")
|
self.set_header("Content-Type", "application/json;charset=UTF-8'")
|
||||||
try:
|
try:
|
||||||
out = json.dumps(dict, indent=self.intent, ensure_ascii=False, sort_keys=True)
|
out = json.dumps(dict, indent=self.intent, ensure_ascii=False, sort_keys=True)
|
||||||
callback = self.request.headers.get('callback', None) or self.request.headers.get('jsonp', None)
|
callback = self.get_query_argument('callback', None) or self.get_query_argument('jsonp', None)
|
||||||
if callback != None:
|
if callback != None:
|
||||||
out = callback + '(' + out + ');' # wrap with JSONP call if requested
|
out = callback + '(' + out + ');' # wrap with JSONP call if requested
|
||||||
except Exception, e: # if we fail to generate the output fake an error
|
except Exception, e: # if we fail to generate the output fake an error
|
||||||
@ -186,7 +186,7 @@ class Api(webserve.MainHandler):
|
|||||||
del kwargs["apikey"]
|
del kwargs["apikey"]
|
||||||
|
|
||||||
if not sickbeard.USE_API:
|
if not sickbeard.USE_API:
|
||||||
msg = u"API :: " + remoteIp + " - SB API Disabled. ACCESS DENIED"
|
msg = u"API :: " + remoteIp + " - SR API Disabled. ACCESS DENIED"
|
||||||
return False, msg, args, kwargs
|
return False, msg, args, kwargs
|
||||||
elif apiKey == realKey:
|
elif apiKey == realKey:
|
||||||
msg = u"API :: " + remoteIp + " - gave correct API KEY. ACCESS GRANTED"
|
msg = u"API :: " + remoteIp + " - gave correct API KEY. ACCESS GRANTED"
|
||||||
@ -713,7 +713,7 @@ class CMD_ComingEpisodes(ApiCall):
|
|||||||
"optionalParameters": {"sort": {"desc": "change the sort order"},
|
"optionalParameters": {"sort": {"desc": "change the sort order"},
|
||||||
"type": {"desc": "one or more of allowedValues separated by |"},
|
"type": {"desc": "one or more of allowedValues separated by |"},
|
||||||
"paused": {
|
"paused": {
|
||||||
"desc": "0 to exclude paused shows, 1 to include them, or omitted to use the SB default"},
|
"desc": "0 to exclude paused shows, 1 to include them, or omitted to use the SR default"},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user