Skip to content

Commit

Permalink
Revert "Merge pull request #6986 from nextcloud/feature/alwaysEnableH…
Browse files Browse the repository at this point in the history
…ttp2"

This reverts commit 5baec6f, reversing
changes made to ab06ecb.

Signed-off-by: Claudio Cambra <[email protected]>
  • Loading branch information
claucambra authored and backportbot[bot] committed Sep 23, 2024
1 parent 7365942 commit 0bba802
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/libsync/accessmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 0bba802

Please sign in to comment.