Skip to content

Commit

Permalink
Disable http2 support for now
Browse files Browse the repository at this point in the history
Issue: #7610
  • Loading branch information
TheOneRing committed Dec 3, 2019
1 parent 78ccf75 commit 4e3eb16
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/libsync/accessmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,10 @@ QNetworkReply *AccessManager::createRequest(QNetworkAccessManager::Operation op,
#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
// Qt 5.12.4 fixed QTBUG-73947 - http2 should be usable after that
bool http2Allowed = QLibraryInfo::version() >= QVersionNumber(5, 12, 4);
// 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;

static auto http2EnabledEnv = qgetenv("OWNCLOUD_HTTP2_ENABLED");
if (http2EnabledEnv == "1")
http2Allowed = true;
if (http2EnabledEnv == "0")
http2Allowed = false;

newRequest.setAttribute(QNetworkRequest::HTTP2AllowedAttribute, http2Allowed);
newRequest.setAttribute(QNetworkRequest::HTTP2AllowedAttribute, http2EnabledEnv);
}
#endif

Expand Down

0 comments on commit 4e3eb16

Please sign in to comment.