Skip to content
Snippets Groups Projects
Commit b9fbe7c6 authored by roadscape's avatar roadscape
Browse files

validate url as str

parent 36725a1b
No related branches found
No related tags found
No related merge requests found
...@@ -45,6 +45,7 @@ LANGS = ("ab,aa,af,ak,sq,am,ar,an,hy,as,av,ae,ay,az,bm,ba,eu,be,bn,bh,bi," ...@@ -45,6 +45,7 @@ LANGS = ("ab,aa,af,ak,sq,am,ar,an,hy,as,av,ae,ay,az,bm,ba,eu,be,bn,bh,bi,"
def _valid_url_proto(url): def _valid_url_proto(url):
assert url assert url
assert isinstance(url, str), 'url was not string'
assert len(url) < 1024, 'url must be shorter than 1024 characters' assert len(url) < 1024, 'url must be shorter than 1024 characters'
return url[0:7] == 'http://' or url[0:8] == 'https://' return url[0:7] == 'http://' or url[0:8] == 'https://'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment