Sfoglia il codice sorgente

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

pull/24/head
Ben Kurtovic 10 anni fa
parent
commit
8f6a02a8f3
1 ha cambiato i file con 4 aggiunte e 1 eliminazioni
  1. +4
    -1
      copyvios/checker.py

+ 4
- 1
copyvios/checker.py Vedi File

@@ -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)


Caricamento…
Annulla
Salva