diff options
author | Øystein Heskestad <oystein.heskestad@qt.io> | 2021-08-03 16:31:52 +0200 |
---|---|---|
committer | Øystein Heskestad <oystein.heskestad@qt.io> | 2021-09-09 16:55:50 +0200 |
commit | 9a602e68cf9dd29638027894032b6052c0526426 (patch) | |
tree | 288622ec0b595a7ecbd33413c3ff0a2b13e9b9c3 /src/network/access/qhttp2protocolhandler.cpp | |
parent | 1fb242ba9f9b7d96c34acafadac3815821ea2f7d (diff) |
Move QNAM's http header parsing into separate class
Fixes: QTBUG-80701
Change-Id: I43f5e102c15d121dba74e07e3cd4bb8aded1c763
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/network/access/qhttp2protocolhandler.cpp')
-rw-r--r-- | src/network/access/qhttp2protocolhandler.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/network/access/qhttp2protocolhandler.cpp b/src/network/access/qhttp2protocolhandler.cpp index b892a6b2a2..26d80f5298 100644 --- a/src/network/access/qhttp2protocolhandler.cpp +++ b/src/network/access/qhttp2protocolhandler.cpp @@ -1150,10 +1150,10 @@ void QHttp2ProtocolHandler::updateStream(Stream &stream, const HPack::HttpHeader statusCode = value.left(3).toInt(); httpReply->setStatusCode(statusCode); m_channel->lastStatus = statusCode; // Mostly useless for http/2, needed for auth - httpReplyPrivate->reasonPhrase = QString::fromLatin1(value.mid(4)); + httpReply->setReasonPhrase(QString::fromLatin1(value.mid(4))); } else if (name == ":version") { - httpReplyPrivate->majorVersion = value.at(5) - '0'; - httpReplyPrivate->minorVersion = value.at(7) - '0'; + httpReply->setMajorVersion(value.at(5) - '0'); + httpReply->setMinorVersion(value.at(7) - '0'); } else if (name == "content-length") { bool ok = false; const qlonglong length = value.toLongLong(&ok); @@ -1165,7 +1165,7 @@ void QHttp2ProtocolHandler::updateStream(Stream &stream, const HPack::HttpHeader QByteArray binder(", "); if (name == "set-cookie") binder = "\n"; - httpReplyPrivate->fields.append(qMakePair(name, value.replace('\0', binder))); + httpReply->appendHeaderField(name, value.replace('\0', binder)); } } |