Merge pull request #1823 from nextcloud/fix-http2-disable

Disable HTTP/2 for now due to Qt bug, allow enabling it via env var
This commit is contained in:
Michael Schuster 2020-03-02 03:26:43 +01:00 committed by GitHub
commit 7fa44d438d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -95,8 +95,15 @@ 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)
/* Disable http2 for now due to Qt bug but allow enabling it via env var, see: https://github.com/owncloud/client/pull/7620
* and: https://github.com/nextcloud/desktop/pull/1806
* Issue: https://github.com/nextcloud/desktop/issues/1503
*/
if (newRequest.url().scheme() == "https") { // Not for "http": QTBUG-61397
newRequest.setAttribute(QNetworkRequest::HTTP2AllowedAttribute, true);
static const bool http2EnabledEnv = qEnvironmentVariableIntValue("OWNCLOUD_HTTP2_ENABLED") == 1;
newRequest.setAttribute(QNetworkRequest::HTTP2AllowedAttribute, http2EnabledEnv);
}
#endif