Skip to content

Commit 1fea606

Browse files
authored
[qt] Ignore status code with 'data' URLs (mapbox#119)
1 parent d28e4a0 commit 1fea606

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

platform/qt/src/http_request.cpp

+10
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,16 @@ void HTTPRequest::handleNetworkReply(QNetworkReply *reply, const QByteArray& dat
9494
}
9595
}
9696

97+
if (reply->url().scheme() == QStringLiteral("data")) {
98+
if (data.isEmpty()) {
99+
response.data = std::make_shared<std::string>();
100+
} else {
101+
response.data = std::make_shared<std::string>(data.constData(), data.size());
102+
}
103+
callback(response);
104+
return;
105+
}
106+
97107
int responseCode = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
98108

99109
switch(responseCode) {

0 commit comments

Comments
 (0)