From: Oleg Broytman Date: Wed, 31 Jul 2024 16:23:22 +0000 (+0300) Subject: Fix(bkmk_robot_base): Do not pass `localhost` via proxy X-Git-Tag: 5.4.0~15 X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=0300a436b154ce028738a4613b39de919f66862a;p=bookmarks_db.git Fix(bkmk_robot_base): Do not pass `localhost` via proxy --- diff --git a/Robots/bkmk_robot_base.py b/Robots/bkmk_robot_base.py index 90d2875..86f05d0 100644 --- a/Robots/bkmk_robot_base.py +++ b/Robots/bkmk_robot_base.py @@ -339,9 +339,12 @@ class robot_base(Robot): error, http_status_code, redirect_to, headers, content = \ self.get(bookmark, url, accept_charset=accept_charset) - if error is not None: + if error is not None and ( + not url_host.startswith('localhost') and + not url_host.startswith('127.') + ): self.log(' Error : %s' % error) - if self.proxy and error != '404 not_found': + if self.proxy and http_status_code != 404: self.log(' Retrying with the proxy...') error, http_status_code, redirect_to, headers, content = \ self.get(bookmark, url,