Commit d40dc43d authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix QNetworkAccessManager usage

parent 91c94882
...@@ -51,6 +51,9 @@ ScamExpandUrlJob::ScamExpandUrlJob(QObject *parent) ...@@ -51,6 +51,9 @@ ScamExpandUrlJob::ScamExpandUrlJob(QObject *parent)
, d(new ScamExpandUrlJobPrivate) , d(new ScamExpandUrlJobPrivate)
{ {
d->mNetworkAccessManager = new QNetworkAccessManager(this); d->mNetworkAccessManager = new QNetworkAccessManager(this);
d->mNetworkAccessManager->setRedirectPolicy(QNetworkRequest::NoLessSafeRedirectPolicy);
d->mNetworkAccessManager->setStrictTransportSecurityEnabled(true);
d->mNetworkAccessManager->enableStrictTransportSecurityStore(true);
connect(d->mNetworkAccessManager, &QNetworkAccessManager::finished, this, connect(d->mNetworkAccessManager, &QNetworkAccessManager::finished, this,
&ScamExpandUrlJob::slotExpandFinished); &ScamExpandUrlJob::slotExpandFinished);
......
...@@ -46,6 +46,10 @@ CheckPhishingUrlJob::CheckPhishingUrlJob(QObject *parent) ...@@ -46,6 +46,10 @@ CheckPhishingUrlJob::CheckPhishingUrlJob(QObject *parent)
, d(new WebEngineViewer::CheckPhishingUrlJobPrivate) , d(new WebEngineViewer::CheckPhishingUrlJobPrivate)
{ {
d->mNetworkAccessManager = new QNetworkAccessManager(this); d->mNetworkAccessManager = new QNetworkAccessManager(this);
d->mNetworkAccessManager->setRedirectPolicy(QNetworkRequest::NoLessSafeRedirectPolicy);
d->mNetworkAccessManager->setStrictTransportSecurityEnabled(true);
d->mNetworkAccessManager->enableStrictTransportSecurityStore(true);
connect(d->mNetworkAccessManager, &QNetworkAccessManager::finished, this, &CheckPhishingUrlJob::slotCheckUrlFinished); connect(d->mNetworkAccessManager, &QNetworkAccessManager::finished, this, &CheckPhishingUrlJob::slotCheckUrlFinished);
connect(d->mNetworkAccessManager, &QNetworkAccessManager::sslErrors, this, &CheckPhishingUrlJob::slotSslErrors); connect(d->mNetworkAccessManager, &QNetworkAccessManager::sslErrors, this, &CheckPhishingUrlJob::slotSslErrors);
} }
......
...@@ -56,6 +56,10 @@ CreatePhishingUrlDataBaseJob::CreatePhishingUrlDataBaseJob(QObject *parent) ...@@ -56,6 +56,10 @@ CreatePhishingUrlDataBaseJob::CreatePhishingUrlDataBaseJob(QObject *parent)
, d(new CreatePhishingUrlDataBaseJobPrivate) , d(new CreatePhishingUrlDataBaseJobPrivate)
{ {
d->mNetworkAccessManager = new QNetworkAccessManager(this); d->mNetworkAccessManager = new QNetworkAccessManager(this);
d->mNetworkAccessManager->setRedirectPolicy(QNetworkRequest::NoLessSafeRedirectPolicy);
d->mNetworkAccessManager->setStrictTransportSecurityEnabled(true);
d->mNetworkAccessManager->enableStrictTransportSecurityStore(true);
connect(d->mNetworkAccessManager, &QNetworkAccessManager::finished, this, &CreatePhishingUrlDataBaseJob::slotDownloadDataBaseFinished); connect(d->mNetworkAccessManager, &QNetworkAccessManager::finished, this, &CreatePhishingUrlDataBaseJob::slotDownloadDataBaseFinished);
connect(d->mNetworkAccessManager, &QNetworkAccessManager::sslErrors, this, &CreatePhishingUrlDataBaseJob::slotSslErrors); connect(d->mNetworkAccessManager, &QNetworkAccessManager::sslErrors, this, &CreatePhishingUrlDataBaseJob::slotSslErrors);
} }
......
...@@ -50,6 +50,10 @@ SearchFullHashJob::SearchFullHashJob(QObject *parent) ...@@ -50,6 +50,10 @@ SearchFullHashJob::SearchFullHashJob(QObject *parent)
, d(new SearchFullHashJobPrivate) , d(new SearchFullHashJobPrivate)
{ {
d->mNetworkAccessManager = new QNetworkAccessManager(this); d->mNetworkAccessManager = new QNetworkAccessManager(this);
d->mNetworkAccessManager->setRedirectPolicy(QNetworkRequest::NoLessSafeRedirectPolicy);
d->mNetworkAccessManager->setStrictTransportSecurityEnabled(true);
d->mNetworkAccessManager->enableStrictTransportSecurityStore(true);
connect(d->mNetworkAccessManager, &QNetworkAccessManager::finished, this, &SearchFullHashJob::slotCheckUrlFinished); connect(d->mNetworkAccessManager, &QNetworkAccessManager::finished, this, &SearchFullHashJob::slotCheckUrlFinished);
connect(d->mNetworkAccessManager, &QNetworkAccessManager::sslErrors, this, &SearchFullHashJob::slotSslErrors); connect(d->mNetworkAccessManager, &QNetworkAccessManager::sslErrors, this, &SearchFullHashJob::slotSslErrors);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment