gpt4 book ai didi

c++ - Qt- QNetworkReply 不显示 Content-Length header

转载 作者:塔克拉玛干 更新时间:2023-11-01 19:07:25 26 4
gpt4 key购买 nike

对于某些下载 url,QNetworkReply 对象不包含 Content-Length header 并返回文件大小为 -1。我测试了以下网址:

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

Firefox 中 Live HTTP Headers 显示的 header 如下:

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==

当我执行以下操作时:

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

输出是:

("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")

显然,缺少 Content-Length。那么,他们对此是否有任何解决方案。

最佳答案

我已经记录了一个相同的错误报告。可以在以下网址进行跟踪:

https://bugreports.qt.io/browse/QTBUG-45322

关于c++ - Qt- QNetworkReply 不显示 Content-Length header ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29353254/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com