mirror of
https://github.com/sivel/speedtest-cli.git
synced 2026-08-04 14:49:36 +00:00
Fix python3 upload problem
In python3, if Content-length is not set,urllib.request.AbstractHTTPHandler::do_request_() will use "Transfer-encoding:chunked", which will cause HTTPUploader not to exit until timeout
This commit is contained in:
parent
b2654de410
commit
a8a3265001
1 changed files with 3 additions and 1 deletions
|
|
@ -1522,9 +1522,11 @@ class Speedtest(object):
|
|||
)
|
||||
if pre_allocate:
|
||||
data.pre_allocate()
|
||||
|
||||
headers = {'Content-length': size}
|
||||
requests.append(
|
||||
(
|
||||
build_request(self.best['url'], data, secure=self._secure),
|
||||
build_request(self.best['url'], data, secure=self._secure, headers=headers),
|
||||
size
|
||||
)
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue