dbhub: Push databases using the POST method instead of PUT

This commit is contained in:
Martin Kleusberg
2017-08-15 21:22:05 +02:00
parent 60a48ce9ec
commit 84615258af
3 changed files with 37 additions and 17 deletions

View File

@@ -10,6 +10,8 @@ class QNetworkReply;
class QSslError;
class QProgressDialog;
class QNetworkRequest;
class QHttpMultiPart;
class QFile;
struct sqlite3;
class RemoteDatabase : public QObject
@@ -42,7 +44,7 @@ public:
};
void fetch(const QString& url, RequestType type, const QString& clientCert = QString(), QVariant userdata = QVariant());
void push(const QString& filename, const QString& url, const QString& clientCert,
void push(const QString& filename, const QString& url, const QString& clientCert, const QString& remotename,
const QString& commitMessage = QString(), const QString& licence = QString(), bool isPublic = false);
signals:
@@ -72,6 +74,10 @@ private:
void localAdd(QString filename, QString identity, const QUrl& url);
QString localExists(const QUrl& url, QString identity);
// Helper functions for building multi-part HTTP requests
void addPart(QHttpMultiPart* multipart, const QString& name, const QString& value);
void addPart(QHttpMultiPart* multipart, const QString& name, QFile* file, const QString& filename);
// Before using a new client certificate we need to clear the access and authentication cache of the network manager
// object. Otherwise Qt might reuse the old certificate if the requested URL has been used before.
void clearAccessCache(const QString& clientCert);