Clean up netrc support

This commit is contained in:
Florian Bruhin 2018-02-11 10:29:02 +01:00
parent b64eb8dfe6
commit 772f0025f1
3 changed files with 6 additions and 8 deletions

View File

@ -824,8 +824,7 @@ class WebEngineTab(browsertab.AbstractTab):
# https://bugreports.qt.io/browse/QTBUG-61506 # https://bugreports.qt.io/browse/QTBUG-61506
self.search.clear() self.search.clear()
super()._on_load_started() super()._on_load_started()
if self.data.netrc_used: self.data.netrc_used = False
self.data.netrc_used = False
@pyqtSlot(QWebEnginePage.RenderProcessTerminationStatus, int) @pyqtSlot(QWebEnginePage.RenderProcessTerminationStatus, int)
def _on_render_process_terminated(self, status, exitcode): def _on_render_process_terminated(self, status, exitcode):

View File

@ -270,11 +270,12 @@ class NetworkManager(QNetworkAccessManager):
@pyqtSlot('QNetworkReply*', 'QAuthenticator*') @pyqtSlot('QNetworkReply*', 'QAuthenticator*')
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_success = False
if not self.netrc_used: if not self.netrc_used:
self.netrc_used = True self.netrc_used = True
netrc = shared.netrc_authentication(reply.url(), authenticator) netrc_success = shared.netrc_authentication(reply.url(),
if not netrc: authenticator)
if not netrc_success:
abort_on = self._get_abort_signals(reply) abort_on = self._get_abort_signals(reply)
shared.authentication_required(reply.url(), authenticator, shared.authentication_required(reply.url(), authenticator,
abort_on=abort_on) abort_on=abort_on)

View File

@ -729,9 +729,7 @@ class WebKitTab(browsertab.AbstractTab):
@pyqtSlot() @pyqtSlot()
def _on_load_started(self): def _on_load_started(self):
super()._on_load_started() super()._on_load_started()
nam = self.networkaccessmanager() self.networkaccessmanager().netrc_used = False
if nam.netrc_used:
nam.netrc_used = False
@pyqtSlot() @pyqtSlot()
def _on_frame_load_finished(self): def _on_frame_load_finished(self):