diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2012-01-12 17:26:28 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2012-01-12 17:26:28 +0100 |
commit | 692d015627ecf03fbc23cfdb4afcf398b9a09a51 (patch) | |
tree | 3a3b65808c37aecd4d270b3d40850ae52f33a355 /module/web | |
parent | changed HEAD request (diff) | |
download | pyload-692d015627ecf03fbc23cfdb4afcf398b9a09a51.tar.xz |
scripts for testing and syntax unit test
Diffstat (limited to 'module/web')
-rw-r--r-- | module/web/api_app.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/module/web/api_app.py b/module/web/api_app.py index 1629c1677..160a984df 100644 --- a/module/web/api_app.py +++ b/module/web/api_app.py @@ -11,6 +11,7 @@ from utils import toDict, set_session from webinterface import PYLOAD from module.common.json_layer import json +from module.utils import remove_chars from module.lib.SafeEval import const_eval as literal_eval from module.Api import BaseObject @@ -33,7 +34,8 @@ def call_api(func, args=""): s = request.environ.get('beaker.session') if 'session' in request.POST: - s = s.get_by_id(request.POST['session']) + # removes "' so it works on json strings + s = s.get_by_id(remove_chars(request.POST['session'], "'\"")) if not s or not s.get("authenticated", False): return HTTPError(403, json.dumps("Forbidden")) |