Scrapy, a fast high-level web crawling & scraping framework for Python.
refactored url_has_any_extension function
Yann Defretin0905d42e3387
diff --git a/scrapy/utils/url.py b/scrapy/utils/url.pyindex bae5a9433..4d5e9ae82 100644--- a/scrapy/utils/url.py+++ b/scrapy/utils/url.py@@ -31,7 +31,8 @@ def url_is_from_spider(url, spider):def url_has_any_extension(url, extensions):"""Return True if the url ends with one of the extensions provided"""- return any(parse_url(url).path.lower().endswith(ext) for ext in extensions)+ lowercase_path = parse_url(url).path.lower()+ return any(lowercase_path.endswith(ext) for ext in extensions)def parse_url(url, encoding=None):"""Return urlparsed url from the given argument (which could be an already