summaryrefslogtreecommitdiffstats
path: root/pyload/web
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-09-17 14:23:28 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-09-17 14:23:28 +0200
commitd53f3b99a1f5176caa94fcbdd3e3fe59f346ece1 (patch)
tree52280c0176566f27d225efcf6ae75f5c28c61a88 /pyload/web
parentstub class for content provider (diff)
downloadpyload-d53f3b99a1f5176caa94fcbdd3e3fe59f346ece1.tar.xz
more fixes for py2.5
Diffstat (limited to 'pyload/web')
-rw-r--r--pyload/web/api_app.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/pyload/web/api_app.py b/pyload/web/api_app.py
index af5c3074c..d0a41b4d0 100644
--- a/pyload/web/api_app.py
+++ b/pyload/web/api_app.py
@@ -44,14 +44,14 @@ def call_api(func, args=""):
api = get_user_api(s)
if not api:
- return HTTPError(401, dumps("Unauthorized"), **response.headers)
+ return error(401, "Unauthorized")
if not PYLOAD.isAuthorized(func, api.user):
- return HTTPError(403, dumps("Forbidden"), **response.headers)
+ return error(403, "Forbidden")
if not hasattr(PYLOAD.EXTERNAL, func) or func.startswith("_"):
print "Invalid API call", func
- return HTTPError(404, dumps("Not Found"), **response.headers)
+ return error(404, "Not Found")
# TODO: possible encoding
# TODO Better error codes on invalid input
@@ -65,7 +65,6 @@ def call_api(func, args=""):
# file upload, reads whole file into memory
for name, f in request.files.iteritems():
- print f.length
kwargs["filename"] = f.filename
kwargs[name] = f.value