getFeed risolve gli URL relativi (fix 'Protocol "" is unknown' sui link di categoria)
This commit is contained in:
+4
-2
@@ -71,8 +71,10 @@ QNetworkReply *ApiClient::startGet(const QUrl &url)
|
|||||||
|
|
||||||
void ApiClient::getFeed(const QString &url)
|
void ApiClient::getFeed(const QString &url)
|
||||||
{
|
{
|
||||||
qDebug() << "getFeed request:" << url;
|
// i link dei feed OPDS sono spesso relativi (/opds/new): risolvi contro il server
|
||||||
QNetworkReply *reply = startGet(QUrl(url));
|
const QString resolved = resolveUrl(url);
|
||||||
|
qDebug() << "getFeed request:" << resolved;
|
||||||
|
QNetworkReply *reply = startGet(QUrl(resolved));
|
||||||
connect(reply, &QNetworkReply::finished, this, [this, reply]() {
|
connect(reply, &QNetworkReply::finished, this, [this, reply]() {
|
||||||
reply->deleteLater();
|
reply->deleteLater();
|
||||||
const int status = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
|
const int status = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
|
||||||
|
|||||||
Reference in New Issue
Block a user