From 6e87548729b2e03ff819d0e802b3f820d43fc846 Mon Sep 17 00:00:00 2001 From: Bionus Date: Sun, 26 Mar 2023 18:25:12 +0200 Subject: [PATCH] fix: properly handle image redirects with HTML body --- src/lib/src/downloader/file-downloader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/src/downloader/file-downloader.cpp b/src/lib/src/downloader/file-downloader.cpp index 3ae88c22b..2cc624257 100644 --- a/src/lib/src/downloader/file-downloader.cpp +++ b/src/lib/src/downloader/file-downloader.cpp @@ -60,7 +60,7 @@ void FileDownloader::replyFinished() const auto msg = m_reply->errorString(); const QUrl redirectUrl = m_reply->attribute(QNetworkRequest::RedirectionTargetAttribute).toUrl(); const bool failedLastWrite = data.length() > 0 && written < 0; - const bool invalidHtml = !m_allowHtmlResponses && isHtml(data); + const bool invalidHtml = !m_allowHtmlResponses && isHtml(data) && redirectUrl.isEmpty(); const bool emptyFile = m_readSize == 0 && redirectUrl.isEmpty(); if (error != NetworkReply::NetworkError::NoError || failedLastWrite || invalidHtml || emptyFile) {