Fix OctoWoW cloning behind BlazingFastWeb

This commit is contained in:
2026-09-12 15:27:25 +02:00
parent d05393d2f5
commit e77263d40d
+14
View File
@@ -28,6 +28,8 @@
#include <QCommandLineParser>
#include <QtLogging>
#include <QWindow>
#include <git2.h>
#include <git2/version.h>
QtMessageHandler originalHandler = nullptr;
@@ -90,6 +92,18 @@ int main(int argc, char *argv[])
engine.load(QUrl(QStringLiteral("qrc:/Update.qml")));
} else {
Control::instance()->init();
#ifdef LIBGIT2_VERSION_CHECK
#if LIBGIT2_VERSION_CHECK(1, 8, 1)
// OctoWoW is protected by BlazingFastWeb, which serves an HTML
// challenge to clients using the default git/* User-Agent.
// Use the curl User-Agent that the server accepts while keeping
// libgit2's normal Git Smart HTTP implementation unchanged.
git_libgit2_opts(GIT_OPT_SET_USER_AGENT_PRODUCT, "curl/8.21.0");
git_libgit2_opts(GIT_OPT_SET_USER_AGENT, "");
#endif
#endif
qmlRegisterUncreatableType<Addon>("GitAddonsManager.engine",1,0,"Addon","");
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
if (parser.isSet("oneshot")) {