Details
-
Bug
-
Resolution: Done
-
P2: Important
-
None
-
5.12.2
-
None
Description
Related to QTBUG-60105 (jefernan)
I have been playing a bit with QHttpServer and noticed that it does not handle the HTTP body correctly, for chunked requests - for example if I send HTTP POST, with body that is just plain binary data, the QHttpServerRequest::body() contains only the last chunk received.
Just from a quick browse through the code:
int QHttpServerRequestPrivate::onBody(http_parser *httpParser, const char *at, size_t length) { qCDebug(lc) << httpParser << QString::fromUtf8(at, int(length)); auto i = instance(httpParser); i->state = State::OnBody; i->body = QByteArray(at, int(length)); return 0; }
The code should probably check that part of the body was already received?
Attachments
Issue Links
- is required for
-
QTBUG-60105 Finalisation of Lightweight HTTP server
- Open