mirror of
https://github.com/nextcloud/desktop.git
synced 2024-10-24 05:15:40 +03:00
AccessManager: Disable HTTP/2 without TLS
Qt would otherwise still try to do HTTP/2 connection even over "http://". And that does not work with server that does not support it
This commit is contained in:
parent
520923b5a7
commit
b1363d1a79
1 changed files with 5 additions and 2 deletions
|
@ -94,8 +94,11 @@ QNetworkReply *AccessManager::createRequest(QNetworkAccessManager::Operation op,
|
|||
newRequest.setRawHeader("X-Request-ID", requestId);
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 9, 0)
|
||||
// only enable HTTP2 with Qt 5.9 because Qt 5.8.0 has too many bugs (only use one connection if the server does not support HTTP2)
|
||||
newRequest.setAttribute(QNetworkRequest::HTTP2AllowedAttribute, true);
|
||||
// only enable HTTP2 with Qt 5.9 because Qt 5.8.0 has too many bugs
|
||||
// (only use one connection if the server does not support HTTP2)
|
||||
if (newRequest.url().scheme() == "https") { // Not for "http": QTBUG-61397
|
||||
newRequest.setAttribute(QNetworkRequest::HTTP2AllowedAttribute, true);
|
||||
}
|
||||
#endif
|
||||
|
||||
return QNetworkAccessManager::createRequest(op, newRequest, outgoingData);
|
||||
|
|
Loading…
Reference in a new issue