changeset 4889:5a1cd703a888

changeset: don't crash on malformed whitespace parameter - return 400 Bad Request
author Andrew Shadura <andrew@shadura.me>
date Thu, 26 Feb 2015 16:44:47 +0100
parents 66d6dc56479b
children 9ff4b82f56c9
files kallithea/controllers/changeset.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/controllers/changeset.py	Fri Mar 06 16:37:19 2015 +0100
+++ b/kallithea/controllers/changeset.py	Thu Feb 26 16:44:47 2015 +0100
@@ -75,7 +75,10 @@
     ig_ws_global = GET.get('ignorews')
     ig_ws = filter(lambda k: k.startswith('WS'), GET.getall(fid))
     if ig_ws:
-        return int(ig_ws[0].split(':')[-1])
+        try:
+            return int(ig_ws[0].split(':')[-1])
+        except ValueError:
+            raise HTTPBadRequest()
     return ig_ws_global