Skip to content

Commit

Permalink
fix: properly handle image redirects with HTML body
Browse files Browse the repository at this point in the history
  • Loading branch information
Bionus committed Mar 26, 2023
1 parent 5b162cb commit 6e87548
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/src/downloader/file-downloader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 6e87548

Please sign in to comment.