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

Qt doesn't handle 302 redirect correctly for HTTP/1.1 PUT

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • 6.7, 6.8
    • Network: HTTP
    • None

      After encountering QTBUG-132277 and disabling HTTP/2 on load balancer, a redirect from a HTTP/1.1 connection fails to correctly continue request processing. This is evident by the attached Wireshark screen grabs demonstrating that after remote end closes the connection, and Qt retries multiple times, ultimately failing.

      1. Application dispatches a network request to QNetworkAccessManager with ManualRedirectPolicy.
      2. Qt issues a HTTP 1.1 PUT on a large file
      3. Backend responds with a HTTP 302 redirect to a different location, while Qt is still uploading the large file
      4. Backend closes connection after issuing 302
      5. Qt automatically retries PUT to the original URL
      6. 2-5 is repeated four times
      7. Qt reports failure to the application with QNetworkReply::RemoteHostClosedConnection

      If the remote end doesn't close the connection after 302, everything works (but incorrectly uploads to both endpoints).

      This works correctly with HTTP/2, in this case we see a reset stream instead of connection closed when inspecting protocol exchange.

        1. le-shark.jpeg
          296 kB
          Henrik Hartz
        2. http2.jpg
          356 kB
          Henrik Hartz
        3. http-request.cpp
          3 kB
          Henrik Hartz
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            manordheim MÃ¥rten Nordheim
            henrik.hartz Henrik Hartz
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes