From 5f1d64d9b6ef0d5c1c8a3fabbf6139e1a2a6d2b4 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Fri, 20 Jan 2012 00:15:43 +0100 Subject: fix cnl for localhost domain --- module/web/cnl_app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/web/cnl_app.py') diff --git a/module/web/cnl_app.py b/module/web/cnl_app.py index d8f7c1180..fe308ec04 100644 --- a/module/web/cnl_app.py +++ b/module/web/cnl_app.py @@ -18,7 +18,7 @@ except: def local_check(function): def _view(*args, **kwargs): if request.environ.get('REMOTE_ADDR', "0") in ('127.0.0.1', 'localhost') \ - or request.environ.get('HTTP_HOST','0') == '127.0.0.1:9666': + or request.environ.get('HTTP_HOST','0') in ('127.0.0.1:9666', 'localhost:9666'): return function(*args, **kwargs) else: return HTTPError(403, "Forbidden") -- cgit v1.2.3 From 58c48fbbbac6b85732d6a4f44ccb1aa126d6117d Mon Sep 17 00:00:00 2001 From: RaNaN Date: Sun, 29 Jan 2012 12:41:21 +0100 Subject: closed #523 --- module/web/cnl_app.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'module/web/cnl_app.py') diff --git a/module/web/cnl_app.py b/module/web/cnl_app.py index fe308ec04..b6a98a0a8 100644 --- a/module/web/cnl_app.py +++ b/module/web/cnl_app.py @@ -6,6 +6,8 @@ from urllib import unquote from base64 import standard_b64decode from binascii import unhexlify +from module.utils.fs import save_filename + from bottle import route, request, HTTPError from webinterface import PYLOAD, DL_ROOT, JS @@ -53,7 +55,7 @@ def addcrypted(): package = request.forms.get('referer', 'ClickAndLoad Package') dlc = request.forms['crypted'].replace(" ", "+") - dlc_path = join(DL_ROOT, package.replace("/", "").replace("\\", "").replace(":", "") + ".dlc") + dlc_path = join(DL_ROOT, save_filename(package) + ".dlc") dlc_file = open(dlc_path, "wb") dlc_file.write(dlc) dlc_file.close() -- cgit v1.2.3