Enable http/3 support

This commit is contained in:
Nicolas Werner 2022-11-20 03:51:44 +01:00
parent 30bbfeaea6
commit 5b929c9d1a
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9
3 changed files with 16 additions and 9 deletions

View file

@ -10,6 +10,7 @@
#include <QMetaType>
#include <QObject>
#include <QStandardPaths>
#include <QString>
#include "nlohmann/json.hpp"
@ -33,7 +34,13 @@ namespace http {
mtx::http::Client *
client()
{
static auto client_ = std::make_shared<mtx::http::Client>();
static auto client_ = [] {
auto c = std::make_shared<mtx::http::Client>();
c->alt_svc_cache_path((QStandardPaths::writableLocation(QStandardPaths::CacheLocation) +
"/curl_alt_svc_cache.txt")
.toStdString());
return c;
}();
return client_.get();
}