Commit 1237e143 authored by Pierre Ducroquet's avatar Pierre Ducroquet 🛩 Committed by Laurent Montel
Browse files

Specify in our Accept header that we want RSS/Atom

It has been reported that at least one feed exists (https://fd.nl/?rss) will *not* send
the same content depending on your accept header. If we use the default accept header,
we receive an XML document with invalid content.
parent 0d7f76c2
Pipeline #35421 failed with stage
in 9 minutes and 52 seconds
......@@ -31,6 +31,7 @@ void FeedRetriever::retrieveData(const QUrl &url)
auto job = KIO::storedGet(url, KIO::NoReload, KIO::HideProgressInfo);
job->addMetaData(QStringLiteral("UserAgent"), userAgent);
job->addMetaData(QStringLiteral("accept"), QStringLiteral("application/rss+xml;q=0.9, application/atom+xml;q=0.9, text/*;q=0.8, */*;q=0.7"));
job->addMetaData(QStringLiteral("cache"), useCache ? QStringLiteral("refresh") : QStringLiteral("reload"));
connect(job, &KJob::result, this, &FeedRetriever::getFinished);
mJob = job;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment