summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-11-20 12:34:22 (GMT)
committerMontel Laurent <montel@kde.org>2016-11-20 12:34:22 (GMT)
commitd733c0cd61e390f4e5e6a2192fa63466cb57b926 (patch)
treeb3ff45beb2da9832a3045f86b1313f2c9c080013
parent48069042eaccc944e98a7ae63d5a22c71a074cf0 (diff)
Fix request json
-rw-r--r--webengineviewer/src/checkphishingurl/searchfullhashjob.cpp10
-rw-r--r--webengineviewer/src/checkphishingurl/searchfullhashjob.h3
2 files changed, 9 insertions, 4 deletions
diff --git a/webengineviewer/src/checkphishingurl/searchfullhashjob.cpp b/webengineviewer/src/checkphishingurl/searchfullhashjob.cpp
index ae43374..495149d 100644
--- a/webengineviewer/src/checkphishingurl/searchfullhashjob.cpp
+++ b/webengineviewer/src/checkphishingurl/searchfullhashjob.cpp
@@ -163,7 +163,7 @@ QByteArray SearchFullHashJob::jsonRequest() const
map.insert(QStringLiteral("client"), clientMap);
//clientStates
- const QVariantList clientStatesList = { QString() }; //Add client states
+ const QVariantList clientStatesList = { mDatabaseHash };
map.insert(QStringLiteral("clientStates"), clientStatesList);
@@ -175,11 +175,8 @@ QByteArray SearchFullHashJob::jsonRequest() const
threatMap.insert(QStringLiteral("threatTypes"), threatTypesList);
const QVariantList threatEntryTypesList = { QStringLiteral("URL") };
threatMap.insert(QStringLiteral("threatEntryTypes"), threatEntryTypesList);
- QVariantList threatEntriesList;
QVariantMap hashUrlMap;
hashUrlMap.insert(QStringLiteral("hash"), mHash);
- threatEntriesList.append(hashUrlMap);
- threatMap.insert(QStringLiteral("threatEntries"), threatEntriesList);
map.insert(QStringLiteral("threatInfo"), threatMap);
@@ -224,3 +221,8 @@ bool SearchFullHashJob::canStart() const
{
return !mHash.isEmpty();
}
+
+void SearchFullHashJob::setDatabaseState(const QString &hash)
+{
+ mDatabaseHash = hash;
+}
diff --git a/webengineviewer/src/checkphishingurl/searchfullhashjob.h b/webengineviewer/src/checkphishingurl/searchfullhashjob.h
index 6eb6bce..141efa1 100644
--- a/webengineviewer/src/checkphishingurl/searchfullhashjob.h
+++ b/webengineviewer/src/checkphishingurl/searchfullhashjob.h
@@ -46,6 +46,8 @@ public:
void start();
bool canStart() const;
+ void setDatabaseState(const QString &hash);
+
QByteArray jsonRequest() const;
void parse(const QByteArray &replyStr);
void setUseCompactJson(bool useCompactJson);
@@ -61,6 +63,7 @@ private Q_SLOTS:
void slotCheckUrlFinished(QNetworkReply *reply);
private:
QByteArray mHash;
+ QString mDatabaseHash;
bool mUseCompactJson;
QNetworkAccessManager *mNetworkAccessManager;
};