mirror of
https://github.com/thoughtbot/capybara-webkit
synced 2023-03-27 23:22:28 -04:00
Fix OS X keychain bug in Qt 5
* Performing basic auth would pop up a keychain dialog * Pressing "Accept" resulted in an infinite loop
This commit is contained in:
parent
87418b89db
commit
b5ca7e6057
2 changed files with 12 additions and 0 deletions
|
@ -8,6 +8,7 @@
|
|||
NetworkAccessManager::NetworkAccessManager(QObject *parent):QNetworkAccessManager(parent) {
|
||||
connect(this, SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)), SLOT(provideAuthentication(QNetworkReply*,QAuthenticator*)));
|
||||
connect(this, SIGNAL(finished(QNetworkReply *)), this, SLOT(finished(QNetworkReply *)));
|
||||
disableKeyChainLookup();
|
||||
}
|
||||
|
||||
QNetworkReply* NetworkAccessManager::createRequest(QNetworkAccessManager::Operation operation, const QNetworkRequest &request, QIODevice * outgoingData = 0) {
|
||||
|
@ -93,3 +94,12 @@ bool NetworkAccessManager::isBlacklisted(QUrl url) {
|
|||
return false;
|
||||
};
|
||||
|
||||
/*
|
||||
* This is a workaround for a Qt 5/OS X bug:
|
||||
* https://bugreports.qt-project.org/browse/QTBUG-30434
|
||||
*/
|
||||
void NetworkAccessManager::disableKeyChainLookup() {
|
||||
QNetworkProxy fixedProxy = proxy();
|
||||
fixedProxy.setHostName(" ");
|
||||
setProxy(fixedProxy);
|
||||
}
|
||||
|
|
|
@ -24,6 +24,8 @@ class NetworkAccessManager : public QNetworkAccessManager {
|
|||
QList<QUrl> m_urlBlacklist;
|
||||
|
||||
private:
|
||||
void disableKeyChainLookup();
|
||||
|
||||
QHash<QString, QString> m_headers;
|
||||
bool isBlacklisted(QUrl url);
|
||||
QHash<QUrl, QUrl> m_redirectMappings;
|
||||
|
|
Loading…
Reference in a new issue