add URL validation for trailing slash (closes #18)

Signed-off-by: r4sas <r4sas@i2pmail.org>
This commit is contained in:
r4sas
2019-09-09 14:23:30 +00:00
parent 692335ee62
commit 7c5ba2fdbe
2 changed files with 10 additions and 2 deletions

View File

@@ -23,3 +23,9 @@ def check_writable(f):
def json_encode(s):
return json.dumps(s, separators=(',',':')).encode()
def validate_url(s):
if not s.endswith('/'):
s = s + "/"
return s