From 8f6a02a8f32c3e08a40f6ad8f2cdd02d09fe2b1f Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Wed, 20 Aug 2014 06:15:16 -0400 Subject: [PATCH] If no scheme is given for the URL, add http:// --- copyvios/checker.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/copyvios/checker.py b/copyvios/checker.py index 7ccf9b0..63589e4 100644 --- a/copyvios/checker.py +++ b/copyvios/checker.py @@ -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)