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

QT stopped understanding HTTP response compressed with gzip.

    XMLWordPrintable

Details

    • Windows
    • f84c83be5 (dev), a7ad2641c (6.8), 80f023702 (tqtc/lts-6.5)

    Description

      In my app I have a code like this:

      QNetworkAccessManager m_nm; 
      void func()
      {
          QNetworkRequest request; 
          request.setUrl("https://api.binance.com/api/v3/exchangeInfo"); 
          QNetworkReply* reply = m_nm.get(request); 
          // ...
      }
      
      // in the signal handler:
      const QString answer = reply->readAll();
      // parse the answer  

      Today it stopped working and I got the corrupted response and the following logs in my app:
       

      As you can see, the response contains `content-encoding=gzip` header. 

      the workaround was to add the following line of code:
       

      request.setRawHeader(QByteArray("Accept-Encoding"), QByteArray("deflate, br"));

      that prevents the response from being compressed with gzip.

      After that my app started to work and I did not investigate this anymore and the only thing I can suggest is that Binance changed something on its servers and QT stopped understanding its responses.

      For example, Postman handles the response compressed with gzip:

       

      Attachments

        1. bin-encoding1.png
          69 kB
          Dmitry Efimov
        2. image-2024-10-04-16-22-18-559.png
          93 kB
          Dmitry Efimov
        3. image-2024-10-04-20-42-36-147.png
          9 kB
          Dmitry Efimov
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            manordheim Mårten Nordheim
            dmitriano Dmitry Efimov
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes