Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-74843

QHttpServer HTTP chunked request body handling

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • None
    • 5.12.2
    • Network
    • None
    • Windows

    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

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              mikhailsvetkin Mikhail Svetkin
              dimitar Dimitar Gospodinov
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes