kioslave: do not redirect to the original URL from curl slave

now that QHostInfo resolves in a more relaxed way (without NI_NAMEREQD
flag) it can happen that the hostname of the result is the address
itself

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2024-03-29 06:07:01 +02:00
parent a4ce7d439c
commit 599c76018a

View file

@ -921,9 +921,12 @@ bool CurlProtocol::setupCurl(const KUrl &url, const bool ftp)
KUrl newurl(url);
newurl.setHost(urlinfo.hostName());
kDebug(7103) << "Rewrote" << url << "to" << newurl;
redirection(newurl);
finished();
return false;
// NOTE: redirect to the same URL is cycril link error
if (url != newurl) {
redirection(newurl);
finished();
return false;
}
} else {
kWarning(7103) << "Could not resolve" << url.host();
}