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

QNetworkReply not showing Content-Length header

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 4.8.6, 5.4.0, 5.4.1
    • Network: HTTP
    • None

    Description

      For some download urls the QNetworkReply object does not contain the Content-Length header and returns File Size as -1. I tested for the following url:

      http://download-cf.jetbrains.com/webide/PhpStorm-EAP-141.332.tar.gz

      The headers shown by Live HTTP Headers in Firefox are as follows:

      HTTP/1.1 200 OK
      Content-Type: application/x-tar
      Content-Length: 135144452
      Connection: keep-alive
      Date: Mon, 30 Mar 2015 17:49:03 GMT
      Content-Encoding: gzip
      x-amz-meta-s3cmd-attrs: uid:572/gname:cds/uname:cds/gid:574/mode:33188/mtime:1427282503/atime:1427282968/md5:a2ccadce9ae0f356e9c11a6d5dd5a4f0/ctime:1427282503
      Last-Modified: Wed, 25 Mar 2015 11:36:03 GMT
      Etag: "db9a27ca51b84bac23080028b3e267ef-9"
      Accept-Ranges: bytes
      Server: AmazonS3
      Age: 313
      X-Cache: Miss from cloudfront
      Via: 1.1 f94856caaa8ad33df4ddf975899fadd2.cloudfront.net (CloudFront)
      X-Amz-Cf-Id: GFsaZTTMQ5eQ54JOUzBfJmIHL6AolKkXknb2HAcfbCKsbIYgdJng_Q==

      And when I do following:

      qDebug()<<reply->rawHeaderList();

      The output is:

      ("Content-Type", "Connection", "Date", "Content-Encoding",
      "x-amz-meta-s3cmd-attrs", "Last-Modified",
      "ETag", "Accept-Ranges", "Server", "Age", "X-Cache",
      "Via", "X-Amz-Cf-Id")

      Clearly, Content-Length is missing. So, is their any solution for this.

      Attachments

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

        Activity

          People

            peter-har Peter Hartmann
            adnan-kamili Syed Adnan Kamili
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes