Skip to content

Commit

Permalink
Skip proxy auth settings if proxy is disabled
Browse files Browse the repository at this point in the history
This does not really change anything but it makes more sense
  • Loading branch information
elpaso committed Nov 10, 2017
1 parent d8fc6e8 commit e85897c
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions src/core/qgsnetworkaccessmanager.cpp
Expand Up @@ -66,7 +66,7 @@ class QgsNetworkProxyFactory : public QNetworkProxyFactory
return proxies;
}

// no proxies from the proxy factor list check for excludes
// no proxies from the proxy factory list check for excludes
if ( query.queryType() != QNetworkProxyQuery::UrlRequest )
return QList<QNetworkProxy>() << nam->fallbackProxy();

Expand Down Expand Up @@ -364,16 +364,15 @@ void QgsNetworkAccessManager::setupDefaultProxyAndCache()
);
proxy = QNetworkProxy( proxyType, proxyHost, proxyPort, proxyUser, proxyPassword );
}
}

// Setup network proxy authentication configuration
QString authcfg = settings.value( QStringLiteral( "proxy/authcfg" ), "" ).toString();
if ( !authcfg.isEmpty( ) )
{
QgsDebugMsg( QStringLiteral( "setting proxy from stored authentication configuration %1" ).arg( authcfg ) );
// Never crash! Never.
if ( QgsApplication::authManager() )
QgsApplication::authManager()->updateNetworkProxy( proxy, authcfg );
// Setup network proxy authentication configuration
QString authcfg = settings.value( QStringLiteral( "proxy/authcfg" ), "" ).toString();
if ( !authcfg.isEmpty( ) )
{
QgsDebugMsg( QStringLiteral( "setting proxy from stored authentication configuration %1" ).arg( authcfg ) );
// Never crash! Never.
if ( QgsApplication::authManager() )
QgsApplication::authManager()->updateNetworkProxy( proxy, authcfg );
}
}

setFallbackProxyAndExcludes( proxy, excludes );
Expand Down

0 comments on commit e85897c

Please sign in to comment.