Skip to content

Commit 75d4d0e

Browse files
committed
fix: 修复漏洞
1 parent 1a41f68 commit 75d4d0e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/storages/alist.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ async def measure(self, size: int) -> str:
102102
if data["code"] != 200:
103103
logger.debug(2)
104104
try:
105-
buffer = b"\x00\x66\xcc\xff" * 256 * 1024
106-
response = await session.put("/api/fs/put", data=buffer, headers={**self.headers, "File-Path": file_path, "Content-Type": "application/octet-stream"})
105+
buffer = b"\x00\x66\xcc\xff" * 256 * 1024 * size
106+
response = await session.put("/api/fs/put", data=buffer, headers={**self.headers, "File-Path": file_path, "Content-Type": "application/octet-stream", "Content-Length": str(size * 1024 * 1024)})
107107
response.raise_for_status()
108108
data = await response.json()
109109
if data["code"] != 200:

0 commit comments

Comments
 (0)