kioslave: emit error on HTTP status greater or equal to 400 from http slave

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2022-03-28 01:00:05 +03:00
parent 68414172c4
commit 96b145819b

View file

@ -295,6 +295,13 @@ void HttpProtocol::get(const KUrl &url)
setMetaData(QString::fromLatin1("modified"), httpheader.get(QLatin1String("Last-Modified")));
curl_slist_free_all(curllist);
if (httpheader.status() >= 400) {
kDebug(7103) << "HTTP error" << httpheader.status() << httpheader.errorString();
error(KIO::ERR_NO_CONTENT, httpheader.errorString());
return;
}
finished();
}