Pārlūkot izejas kodu

If no scheme is given for the URL, add http://

pull/24/head
Ben Kurtovic pirms 10 gadiem
vecāks
revīzija
8f6a02a8f3
1 mainītis faili ar 4 papildinājumiem un 1 dzēšanām
  1. +4
    -1
      copyvios/checker.py

+ 4
- 1
copyvios/checker.py Parādīt failu

@@ -52,7 +52,10 @@ def _get_results(query, follow=True):
return _get_results(query, follow=False)

if query.url:
if urlparse(query.url).scheme not in ["http", "https"]:
scheme = urlparse(query.url).scheme
if not scheme and query.url[0] not in ":/":
query.url = "http://" + query.url
elif scheme not in ["http", "https"]:
query.error = "bad URI"
return
result = _do_copyvio_compare(query, page, query.url)


Notiek ielāde…
Atcelt
Saglabāt