summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTadej Novak <tadej@tano.si>2020-04-26 21:33:42 +0200
committerThiago Marcos P. Santos <tmpsantos@gmail.com>2020-04-27 12:46:09 +0300
commitf22bbe38886778dab14760783c77c480e636aaa0 (patch)
tree509272ebef6cf9ebfb64a7e01d7b044fde706ad1
parent8af62305d2e0208357c98e61bc2a9c9de8fe6114 (diff)
downloadqtlocation-mapboxgl-f22bbe38886778dab14760783c77c480e636aaa0.tar.gz
[qt] Ignore status code with 'data' URLs
-rw-r--r--platform/qt/src/http_request.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/platform/qt/src/http_request.cpp b/platform/qt/src/http_request.cpp
index ea3f388bd5..cb64fc517a 100644
--- a/platform/qt/src/http_request.cpp
+++ b/platform/qt/src/http_request.cpp
@@ -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) {