Fix file being passed to --repo

Since #719, you can no longer use a local json file with --repo (At least in Qt 6). A network request to a file:// url has statusCode 0, which caused this check to fail previously.
This commit is contained in:
Aaron Dewes 2023-11-18 19:05:52 +01:00 committed by Tom Dewey
parent bee8d3671a
commit 92fd375886

View file

@ -488,7 +488,7 @@ void ImageWriter::handleNetworkRequestFinished(QNetworkReply *data) {
if (data->error() == QNetworkReply::NoError) {
auto httpStatusCode = data->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
if (httpStatusCode >= 200 && httpStatusCode < 300) {
if (httpStatusCode >= 200 && httpStatusCode < 300 || httpStatusCode == 0) {
auto response_object = QJsonDocument::fromJson(data->readAll()).object();
if (response_object.contains("os_list")) {