From 92fd375886829050473f43cad9d1533696fad6cf Mon Sep 17 00:00:00 2001 From: Aaron Dewes Date: Sat, 18 Nov 2023 19:05:52 +0100 Subject: [PATCH] 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. --- src/imagewriter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/imagewriter.cpp b/src/imagewriter.cpp index 860284c..4d6119a 100644 --- a/src/imagewriter.cpp +++ b/src/imagewriter.cpp @@ -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")) {