diff options
Diffstat (limited to 'src/websockets/qwebsocket_p.cpp')
-rw-r--r-- | src/websockets/qwebsocket_p.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/websockets/qwebsocket_p.cpp b/src/websockets/qwebsocket_p.cpp index 8529538..6965731 100644 --- a/src/websockets/qwebsocket_p.cpp +++ b/src/websockets/qwebsocket_p.cpp @@ -436,6 +436,7 @@ void QWebSocketPrivate::open(const QNetworkRequest &request, bool mask) sslSocket->ignoreSslErrors(m_configuration.m_ignoredSslErrors); #ifndef QT_NO_NETWORKPROXY sslSocket->setProxy(m_configuration.m_proxy); + m_pSocket->setProtocolTag(QStringLiteral("https")); #endif sslSocket->connectToHostEncrypted(url.host(), quint16(url.port(443))); } else { @@ -458,6 +459,7 @@ void QWebSocketPrivate::open(const QNetworkRequest &request, bool mask) setSocketState(QAbstractSocket::ConnectingState); #ifndef QT_NO_NETWORKPROXY m_pSocket->setProxy(m_configuration.m_proxy); + m_pSocket->setProtocolTag(QStringLiteral("http")); #endif m_pSocket->connectToHost(url.host(), quint16(url.port(80))); } else { @@ -965,7 +967,7 @@ void QWebSocketPrivate::processHandshake(QTcpSocket *pSocket) case ReadingStatusState: if (!pSocket->canReadLine()) return; - m_statusLine = pSocket->readLine(); + m_statusLine = pSocket->readLine().trimmed(); if (Q_UNLIKELY(!parseStatusLine(m_statusLine, &m_httpMajorVersion, &m_httpMinorVersion, &m_httpStatusCode, &m_httpStatusMessage))) { errorDescription = QWebSocket::tr("Invalid statusline in response: %1.").arg(QString::fromLatin1(m_statusLine)); break; @@ -1449,6 +1451,7 @@ void QWebSocketPrivate::setReadBufferSize(qint64 size) m_pSocket->setReadBufferSize(m_readBufferSize); } +#ifndef Q_OS_WASM /*! \internal */ @@ -1457,5 +1460,6 @@ bool QWebSocketPrivate::isValid() const return (m_pSocket && m_pSocket->isValid() && (m_socketState == QAbstractSocket::ConnectedState)); } +#endif QT_END_NAMESPACE |