http2: Use QByteArrayView in lambda where we only parse

Thinking back I'm 99% certain I deliberately used QBA because I was
going to cherry-pick it back and didn't feel like dealing with failing
builds. Coming up we will have a lot of other changes here so let's
change this as well.

Change-Id: Ifc60ad8ee2a1e5b75ac766b4a8b7e1559f80e942
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
This commit is contained in:
Mårten Nordheim 2023-06-26 16:11:03 +02:00
parent 991053fdff
commit 8f4e29cc85

View File

@ -1127,9 +1127,9 @@ void QHttp2ProtocolHandler::updateStream(Stream &stream, const HPack::HttpHeader
}
}
const auto handleAuth = [&, this](const QByteArray &authField, bool isProxy) -> bool {
const auto handleAuth = [&, this](QByteArrayView authField, bool isProxy) -> bool {
Q_ASSERT(httpReply);
const auto auth = authField.trimmed();
const QByteArrayView auth = authField.trimmed();
if (auth.startsWith("Negotiate") || auth.startsWith("NTLM")) {
// @todo: We're supposed to fall back to http/1.1:
// https://docs.microsoft.com/en-us/iis/get-started/whats-new-in-iis-10/http2-on-iis#when-is-http2-not-supported