diff --git a/src/network/access/qhttp2protocolhandler.cpp b/src/network/access/qhttp2protocolhandler.cpp index 145d7046b7..23724cc0f0 100644 --- a/src/network/access/qhttp2protocolhandler.cpp +++ b/src/network/access/qhttp2protocolhandler.cpp @@ -309,8 +309,7 @@ bool QHttp2ProtocolHandler::sendRequest() auto &requests = m_channel->h2RequestsToSend; for (auto it = requests.begin(), endIt = requests.end(); it != endIt;) { const auto &pair = *it; - const QString scheme(pair.first.url().scheme()); - if (scheme == "preconnect-http"_L1 || scheme == "preconnect-https"_L1) { + if (pair.first.isPreConnect()) { m_connection->preConnectFinished(); emit pair.second->finished(); it = requests.erase(it); diff --git a/src/network/access/qhttpprotocolhandler.cpp b/src/network/access/qhttpprotocolhandler.cpp index b2576a85e6..19dfc9b164 100644 --- a/src/network/access/qhttpprotocolhandler.cpp +++ b/src/network/access/qhttpprotocolhandler.cpp @@ -238,8 +238,7 @@ bool QHttpProtocolHandler::sendRequest() // _q_connected or _q_encrypted return false; } - QString scheme = m_channel->request.url().scheme(); - if (scheme == "preconnect-http"_L1 || scheme == "preconnect-https"_L1) { + if (m_channel->request.isPreConnect()) { m_channel->state = QHttpNetworkConnectionChannel::IdleState; m_reply->d_func()->state = QHttpNetworkReplyPrivate::AllDoneState; m_channel->allDone();