范围请求。如何确定何时完成文件下载

时间:2019-07-24 08:07:05

标签: http

我有两个HTTP日志,其中有两个文件是从保管箱下载的:“小” InstallSQLiteStudio-01(1).exe(〜33 MB)和“大” Salut.Jagerov.1989.Uncut.avi(〜1.5 GB)。 “小”文件传输一应俱全。 “大”文件传输有两个响应。

我尝试通过HTTP日志了解如何确定何时停止下载。

“小”文件(包括请求和响应)有HTTP日志:

GET /cd/0/get/Akj76yDYVBcwhikrbFSnarEDQ1S8kwNDa9Lkxqdbifp-b5gpm7S1L20S6uwW5Fk3WCbqMxh71q5AsTKciCMlTua8ygYqpZsKYSJkfvtiBbnjDQ/file?dl=1 HTTP/1.1
Host: uc31cf53aec28ba2f81352978acf.dl.dropboxusercontent.com
Connection: keep-alive
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3
Referer: https://www.dropbox.com/
Accept-Language: ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7
Accept-Encoding: gzip, deflate

HTTP/1.1 200 OK
X-EXHDR-REQUEST: GET /cd/0/get/Akj76yDYVBcwhikrbFSnarEDQ1S8kwNDa9Lkxqdbifp-b5gpm7S1L20S6uwW5Fk3WCbqMxh71q5AsTKciCMlTua8ygYqpZsKYSJkfvtiBbnjDQ/file?dl=1 HTTP/1.1
X-EXHDR-REQUEST-HOST: uc31cf53aec28ba2f81352978acf.dl.dropboxusercontent.com
Server: nginx
Date: Fri, 12 Jul 2019 11:38:36 GMT
Content-Type: application/binary
Connection: keep-alive
x-content-security-policy: sandbox
content-disposition: attachment; filename="InstallSQLiteStudio-01(1).exe"; filename*=UTF-8''InstallSQLiteStudio-01%281%29.exe
x-robots-tag: noindex, nofollow, noimageindex
x-content-type-options: nosniff
accept-ranges: bytes
content-security-policy: sandbox
etag: 251d
x-dropbox-request-id: f88637af5cdf15038aeaeb98fb456856
pragma: public
cache-control: max-age=60
referrer-policy: no-referrer
x-webkit-csp: sandbox
Vary: Origin
X-Server-Response-Time: 480
Strict-Transport-Security: max-age=15552000; includeSubDomains
Content-Length: 34862967

file body

“大”文件(包括请求和响应)有HTTP日志:

GET /cd/0/get/AjJw9ZP2VXZWcGybE0aKAauVSaNShR9Qu5meYF_4R-sEVVVhosk9pVjM79_fPJGy0E_F5WJ-_t2XC3DidWyrphTopDFaWwt-Gk7aU9Rm8kFckA/file HTTP/1.1
Host: uca761beb0a1d94b531e70b92049.dl.dropboxusercontent.com
Connection: keep-alive
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3
Referer: https://www.dropbox.com/
Accept-Language: ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7
Accept-Encoding: gzip, deflate

HTTP/1.1 200 OK
X-EXHDR-REQUEST: GET /cd/0/get/AjJw9ZP2VXZWcGybE0aKAauVSaNShR9Qu5meYF_4R-sEVVVhosk9pVjM79_fPJGy0E_F5WJ-_t2XC3DidWyrphTopDFaWwt-Gk7aU9Rm8kFckA/file HTTP/1.1
X-EXHDR-REQUEST-HOST: uca761beb0a1d94b531e70b92049.dl.dropboxusercontent.com
Server: nginx
Date: Thu, 20 Jun 2019 08:46:25 GMT
Content-Type: application/binary
Connection: keep-alive
x-content-security-policy: sandbox
content-disposition: attachment; filename="Salut.Jagerov.1989.Uncut.avi"; filename*=UTF-8''Salut.Jagerov.1989.Uncut.avi
x-robots-tag: noindex, nofollow, noimageindex
x-content-type-options: nosniff
accept-ranges: bytes
content-security-policy: sandbox
etag: 39d
x-dropbox-request-id: 52db32a67f92900b6927b13d797fd0bf
pragma: public
cache-control: max-age=60
referrer-policy: no-referrer
x-webkit-csp: sandbox
Vary: Origin
X-Server-Response-Time: 487
Strict-Transport-Security: max-age=15552000; includeSubDomains
Content-Length: 716094768

first chunk body

GET /cd/0/get/AjJw9ZP2VXZWcGybE0aKAauVSaNShR9Qu5meYF_4R-sEVVVhosk9pVjM79_fPJGy0E_F5WJ-_t2XC3DidWyrphTopDFaWwt-Gk7aU9Rm8kFckA/file HTTP/1.1
Host: uca761beb0a1d94b531e70b92049.dl.dropboxusercontent.com
Connection: keep-alive
Range: bytes=716094768-
If-Range: 39d
Referer: https://www.dropbox.com/
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36
Accept-Language: ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7
Accept-Encoding: identity

HTTP/1.1 206 PARTIAL CONTENT
X-EXHDR-REQUEST: GET /cd/0/get/AjJw9ZP2VXZWcGybE0aKAauVSaNShR9Qu5meYF_4R-sEVVVhosk9pVjM79_fPJGy0E_F5WJ-_t2XC3DidWyrphTopDFaWwt-Gk7aU9Rm8kFckA/file HTTP/1.1
X-EXHDR-REQUEST-HOST: uca761beb0a1d94b531e70b92049.dl.dropboxusercontent.com
Server: nginx
Date: Thu, 20 Jun 2019 08:56:46 GMT
Content-Type: application/binary
Connection: keep-alive
x-content-security-policy: sandbox
content-disposition: attachment; filename="Salut.Jagerov.1989.Uncut.avi"; filename*=UTF-8''Salut.Jagerov.1989.Uncut.avi
x-robots-tag: noindex, nofollow, noimageindex
x-content-type-options: nosniff
accept-ranges: bytes
content-security-policy: sandbox
content-range: bytes 716094768-1565931519/1565931520
etag: 39d
x-dropbox-request-id: 5446cd559ac6ce276e2a72b6aba1098c
pragma: public
cache-control: max-age=60
referrer-policy: no-referrer
x-webkit-csp: sandbox
Vary: Origin
Strict-Transport-Security: max-age=15552000; includeSubDomains
Content-Length: 849836752

last chunk body

当第二响应中的标题“ content-range”停止“大”文件的向下停止时,这很容易理解。对“小”文件和“大”文件的第一个卡盘的请求和响应是相同的。但是,“小”文件的下载在响应后会停止,“大”文件的下载会随着第二个GET请求而继续。

如何通过HTTP日志了解“小”文件的下载已停止,并且不需要再请求一个大块吗?

0 个答案:

没有答案