might as well use the same loop prevention mechanism for both backends

This commit is contained in:
Marc Jauvin 2018-01-19 06:59:40 -05:00
parent a2ca59b822
commit 9e258a490e
2 changed files with 3 additions and 3 deletions

View File

@ -741,7 +741,7 @@ class WebEngineTab(browsertab.AbstractTab):
@pyqtSlot(QUrl, 'QAuthenticator*') @pyqtSlot(QUrl, 'QAuthenticator*')
def _on_authentication_required(self, url, authenticator): def _on_authentication_required(self, url, authenticator):
netrc = None netrc = None
if not self.data.netrc_used and 'HOME' in os.environ: if not self.data.netrc_used:
self.data.netrc_used = True self.data.netrc_used = True
netrc = shared.netrc_authentication(url, authenticator) netrc = shared.netrc_authentication(url, authenticator)
if not netrc: if not netrc:

View File

@ -269,8 +269,8 @@ class NetworkManager(QNetworkAccessManager):
def on_authentication_required(self, reply, authenticator): def on_authentication_required(self, reply, authenticator):
"""Called when a website needs authentication.""" """Called when a website needs authentication."""
netrc = False netrc = False
if not hasattr(reply, "netrc_used"): if not self.data.netrc_used:
setattr(reply, "netrc_used", True) self.data.netrc_used = True
netrc = shared.netrc_authentication(reply.url(), authenticator) netrc = shared.netrc_authentication(reply.url(), authenticator)
if not netrc: if not netrc:
abort_on = self._get_abort_signals(reply) abort_on = self._get_abort_signals(reply)