detect recursive redirects

This commit is contained in:
ebbit1q 2026-01-25 18:55:32 +01:00
parent c02cf5e89e
commit 2dd6e4db43

View file

@ -76,7 +76,15 @@ void CardPictureLoaderWorkerWork::handleNetworkReply(QNetworkReply *reply)
if (redirectUrl.isRelative()) {
redirectUrl = url.resolved(redirectUrl);
}
emit urlRedirected(url, redirectUrl);
if (url == redirectUrl) {
qCWarning(CardPictureLoaderWorkerWorkLog) << "recusive redirect detected!";
qCWarning(CardPictureLoaderWorkerWorkLog) << "refusing to load" << redirectTarget;
reply->deleteLater();
picDownloadFailed();
return;
} else {
emit urlRedirected(url, redirectUrl);
}
}
if (reply->error()) {