Add Subsonic option to turn off HTTP2

Fixes #718
This commit is contained in:
Jonas Kvinge
2021-06-13 19:55:45 +02:00
parent 8cf5707575
commit fbe4d3ce9f
7 changed files with 48 additions and 18 deletions

View File

@@ -73,6 +73,7 @@ SubsonicService::SubsonicService(Application *app, QObject *parent)
collection_backend_(nullptr),
collection_model_(nullptr),
collection_sort_model_(new QSortFilterProxyModel(this)),
http2_(true),
verify_certificate_(false),
download_album_covers_(true),
ping_redirects_(0)
@@ -138,6 +139,7 @@ void SubsonicService::ReloadSettings() {
if (password.isEmpty()) password_.clear();
else password_ = QString::fromUtf8(QByteArray::fromBase64(password));
http2_ = s.value("http2", true).toBool();
verify_certificate_ = s.value("verifycertificate", false).toBool();
download_album_covers_ = s.value("downloadalbumcovers", true).toBool();
@@ -196,6 +198,10 @@ void SubsonicService::SendPingWithCredentials(QUrl url, const QString &username,
req.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded");
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
req.setAttribute(QNetworkRequest::Http2AllowedAttribute, http2_);
#endif
errors_.clear();
QNetworkReply *reply = network_->get(req);
replies_ << reply;