[qt] Ignore status code with 'data' URLs (#119)

This commit is contained in:
Tadej Novak
2021-07-09 12:24:36 +02:00
committed by GitHub
parent d28e4a040f
commit 1fea606676

View File

@@ -94,6 +94,16 @@ void HTTPRequest::handleNetworkReply(QNetworkReply *reply, const QByteArray& dat
}
}
if (reply->url().scheme() == QStringLiteral("data")) {
if (data.isEmpty()) {
response.data = std::make_shared<std::string>();
} else {
response.data = std::make_shared<std::string>(data.constData(), data.size());
}
callback(response);
return;
}
int responseCode = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
switch(responseCode) {