diff options
author | Juha Vuolle <juha.vuolle@qt.io> | 2024-02-08 07:46:21 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2024-02-08 15:02:52 +0000 |
commit | 7288db6083ea1e181fc8ac6e06c2ee3f603cf175 (patch) | |
tree | 52446a81f4187512b671836c7ab9415c55d9230a /src/network/access/qhttp2protocolhandler.cpp | |
parent | 60f471f4b6269827fe2fcaa1f8fbe73db4abe8eb (diff) |
Remove unnecessary case-insensitive header name comparisons
HTTP header name fields are case-insensitive and the QHttpHeaders class
stores them as lower-case. Therefore the case-insensitive comparisons,
when comparing against a lower-case value, are not needed.
Pick-to: 6.7
Change-Id: I7f38ef16aa7c61103abc4c81c13aebdd6e535dc8
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Diffstat (limited to 'src/network/access/qhttp2protocolhandler.cpp')
-rw-r--r-- | src/network/access/qhttp2protocolhandler.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/network/access/qhttp2protocolhandler.cpp b/src/network/access/qhttp2protocolhandler.cpp index 08dfa02624..251d17b0b4 100644 --- a/src/network/access/qhttp2protocolhandler.cpp +++ b/src/network/access/qhttp2protocolhandler.cpp @@ -73,12 +73,10 @@ HPack::HttpHeader build_headers(const QHttpNetworkRequest &request, quint32 maxH if (size.second > maxHeaderListSize) break; - if (name.compare("connection", Qt::CaseInsensitive) == 0 || - name.compare("host", Qt::CaseInsensitive) == 0 || - name.compare("keep-alive", Qt::CaseInsensitive) == 0 || - name.compare("proxy-connection", Qt::CaseInsensitive) == 0 || - name.compare("transfer-encoding", Qt::CaseInsensitive) == 0) + if (name == "connection"_L1 || name == "host"_L1 || name == "keep-alive"_L1 + || name == "proxy-connection"_L1 || name == "transfer-encoding"_L1) { continue; // Those headers are not valid (section 3.2.1) - from QSpdyProtocolHandler + } // TODO: verify with specs, which fields are valid to send .... // // Note: RFC 7450 8.1.2 (HTTP/2) states that header field names must be lower-cased |