]> git.phdru.name Git - bookmarks_db.git/commitdiff
Fix(bkmk_robot_base): Do not pass `localhost` via proxy
authorOleg Broytman <phd@phdru.name>
Wed, 31 Jul 2024 16:23:22 +0000 (19:23 +0300)
committerOleg Broytman <phd@phdru.name>
Wed, 31 Jul 2024 22:48:38 +0000 (01:48 +0300)
Robots/bkmk_robot_base.py

index 90d287543e08d81eb776d70bcb7c14411ab6db41..86f05d0031e4bd0fc4f259d556af32a20bf2be31 100644 (file)
@@ -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,