mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-29 00:51:53 +08:00
refactoring
This commit is contained in:
@@ -51,16 +51,6 @@ def raise_not_200(response: aiohttp.ClientResponse) -> None:
|
||||
)
|
||||
|
||||
|
||||
def get_content_length(response: aiohttp.ClientResponse) -> int:
|
||||
try:
|
||||
value = int(response.headers["Content-Length"])
|
||||
except Exception:
|
||||
raise aiohttp.ClientError("Empty or invalid Content-Length")
|
||||
if value < 0:
|
||||
raise aiohttp.ClientError("Negative Content-Length")
|
||||
return value
|
||||
|
||||
|
||||
def get_filename(response: aiohttp.ClientResponse) -> str:
|
||||
try:
|
||||
disp = response.headers["Content-Disposition"]
|
||||
|
||||
Reference in New Issue
Block a user