Merge pull request #7192 from nextcloud/backport/7182/stable-3.14

[stable-3.14] Revert always enable http2
This commit is contained in:
Claudio Cambra 2024-09-24 10:09:32 +08:00 коммит произвёл GitHub
Родитель 7365942803 0bba8027e6
Коммит 1a91e4fa2a
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
1 изменённых файлов: 10 добавлений и 1 удалений

Просмотреть файл

@ -66,7 +66,16 @@ QNetworkReply *AccessManager::createRequest(QNetworkAccessManager::Operation op,
QByteArray requestId = generateRequestId();
qInfo(lcAccessManager) << op << verb << newRequest.url().toString() << "has X-Request-ID" << requestId;
newRequest.setRawHeader("X-Request-ID", requestId);
newRequest.setAttribute(QNetworkRequest::Http2AllowedAttribute, true);
#if QT_VERSION >= QT_VERSION_CHECK(5, 9, 4)
// only enable HTTP2 with Qt 5.9.4 because old Qt have too many bugs (e.g. QTBUG-64359 is fixed in >= Qt 5.9.4)
if (newRequest.url().scheme() == "https") { // Not for "http": QTBUG-61397
// http2 seems to cause issues, as with our recommended server setup we don't support http2, disable it by default for now
static const bool http2EnabledEnv = qEnvironmentVariableIntValue("OWNCLOUD_HTTP2_ENABLED") == 1;
newRequest.setAttribute(QNetworkRequest::Http2AllowedAttribute, http2EnabledEnv);
}
#endif
const auto reply = QNetworkAccessManager::createRequest(op, newRequest, outgoingData);
HttpLogger::logRequest(reply, op, outgoingData);