Skip to content

Commit

Permalink
[C++] [Qt5] [Client] fixed cpp-client-qt5 HttpRequestWorker contentCo…
Browse files Browse the repository at this point in the history
…mpression variables initialization (#5834)

When contentCompression is not enabled, the variables isRequestCompressionEnabled and isResponseCompressionEnabled in HttpRequestWorker are not being initialized.
Without initialization the compress function could be called and the request content could be an empty QByteArray instead of original request body.
  • Loading branch information
natanlaverde authored Apr 6, 2020
1 parent f1325e2 commit 6cbc442
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void {{prefix}}HttpRequestInput::add_file(QString variable_name, QString local_f
}

{{prefix}}HttpRequestWorker::{{prefix}}HttpRequestWorker(QObject *parent)
: QObject(parent), manager(nullptr), timeOutTimer(this) {
: QObject(parent), manager(nullptr), timeOutTimer(this), isResponseCompressionEnabled(false), isRequestCompressionEnabled(false) {
qsrand(QDateTime::currentDateTime().toTime_t());
manager = new QNetworkAccessManager(this);
workingDirectory = QDir::currentPath();
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/cpp-qt5/.openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.3.0-SNAPSHOT
4.3.1-SNAPSHOT
2 changes: 1 addition & 1 deletion samples/client/petstore/cpp-qt5/client/PFXHttpRequest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ void PFXHttpRequestInput::add_file(QString variable_name, QString local_filename
}

PFXHttpRequestWorker::PFXHttpRequestWorker(QObject *parent)
: QObject(parent), manager(nullptr), timeOutTimer(this) {
: QObject(parent), manager(nullptr), timeOutTimer(this), isResponseCompressionEnabled(false), isRequestCompressionEnabled(false) {
qsrand(QDateTime::currentDateTime().toTime_t());
manager = new QNetworkAccessManager(this);
workingDirectory = QDir::currentPath();
Expand Down

0 comments on commit 6cbc442

Please sign in to comment.