diff --git a/main.cpp b/main.cpp index 79475e1..787df9f 100644 --- a/main.cpp +++ b/main.cpp @@ -28,6 +28,8 @@ #include #include #include +#include +#include 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("GitAddonsManager.engine",1,0,"Addon",""); engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); if (parser.isSet("oneshot")) {