diff options
author | Mårten Nordheim <marten.nordheim@qt.io> | 2021-11-26 13:15:46 +0100 |
---|---|---|
committer | Mårten Nordheim <marten.nordheim@qt.io> | 2021-12-04 08:20:52 +0000 |
commit | 9909ec0bc63325fc115d9d84ab01c08333fd8c53 (patch) | |
tree | 82ed9aaaddcbb11315439d51c3409b67676f3154 /src/network/access/qhttpnetworkrequest.cpp | |
parent | 5074344c9c1fb9a510f333d470d83e8da94072f9 (diff) | |
download | qtbase-9909ec0bc63325fc115d9d84ab01c08333fd8c53.tar.gz |
QNAM: Reintroduce h2c with an attribute
[ChangeLog][QtNetwork][QNetworkRequest] Added
QNetworkRequest::Http2CleartextAllowedAttribute which controls whether
HTTP/2 cleartext (h2c) is allowed or not. The default is false. This
replaces the QT_NETWORK_H2C_ALLOWED environment variable.
Task-number: QTBUG-98642
Change-Id: I43ae1cc671788f6d2559cd316f6667b412c8e75e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/network/access/qhttpnetworkrequest.cpp')
-rw-r--r-- | src/network/access/qhttpnetworkrequest.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/network/access/qhttpnetworkrequest.cpp b/src/network/access/qhttpnetworkrequest.cpp index f419ee2673..cfcface0d2 100644 --- a/src/network/access/qhttpnetworkrequest.cpp +++ b/src/network/access/qhttpnetworkrequest.cpp @@ -61,6 +61,7 @@ QHttpNetworkRequestPrivate::QHttpNetworkRequestPrivate(const QHttpNetworkRequest pipeliningAllowed(other.pipeliningAllowed), http2Allowed(other.http2Allowed), http2Direct(other.http2Direct), + h2cAllowed(other.h2cAllowed), withCredentials(other.withCredentials), ssl(other.ssl), preConnect(other.preConnect), @@ -85,6 +86,7 @@ bool QHttpNetworkRequestPrivate::operator==(const QHttpNetworkRequestPrivate &ot && (pipeliningAllowed == other.pipeliningAllowed) && (http2Allowed == other.http2Allowed) && (http2Direct == other.http2Direct) + && (h2cAllowed == other.h2cAllowed) // we do not clear the customVerb in setOperation && (operation != QHttpNetworkRequest::Custom || (customVerb == other.customVerb)) && (withCredentials == other.withCredentials) @@ -367,12 +369,12 @@ void QHttpNetworkRequest::setHTTP2Direct(bool b) bool QHttpNetworkRequest::isH2cAllowed() const { - return qEnvironmentVariableIsSet("QT_NETWORK_H2C_ALLOWED"); + return d->h2cAllowed; } void QHttpNetworkRequest::setH2cAllowed(bool b) { - Q_UNUSED(b); + d->h2cAllowed = b; } bool QHttpNetworkRequest::withCredentials() const |