v1.3.14 fix: 网络上传测速改浏览器UA(Cloudflare拦默认UA)
This commit is contained in:
1 parent
1aff3138cb
commit
392f6a737c
1 file changed
+2
-1
@@ -598,7 +598,8 @@ def _bench_net():
|
||||
t0 = time.perf_counter()
|
||||
req = _urlreq.Request("https://speed.cloudflare.com/__up",
|
||||
data=payload, method="POST",
|
||||
headers={"Content-Type": "application/octet-stream"})
|
||||
headers={"Content-Type": "application/octet-stream",
|
||||
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)"})
|
||||
with _urlreq.urlopen(req, timeout=25) as r:
|
||||
r.read()
|
||||
dt = max(time.perf_counter() - t0, 1e-6)
|
||||
|
||||
Reference in new issue
Block a user