fix delete connection POST request
This commit is contained in:
1 parent
27f2314c96
commit
5141bcdb0f
5 files changed
+28
-12
No files matched your search
@@ -75,18 +75,27 @@ def parse_size(size_str):
|
||||
size_str = size_str.upper().strip()
|
||||
logger.info(f"parse_size called with: '{size_str}'")
|
||||
|
||||
if size_str.endswith('M') or size_str.endswith('MB'):
|
||||
# Remove 'M' or 'MB' and convert to bytes
|
||||
if size_str.endswith('MB'):
|
||||
result = int(float(size_str[:-2]) * 1024 * 1024)
|
||||
logger.info(f"parse_size result: {result} bytes (from {size_str})")
|
||||
return result
|
||||
elif size_str.endswith('M'):
|
||||
result = int(float(size_str[:-1]) * 1024 * 1024)
|
||||
logger.info(f"parse_size result: {result} bytes (from {size_str})")
|
||||
return result
|
||||
elif size_str.endswith('K') or size_str.endswith('KB'):
|
||||
# Remove 'K' or 'KB' and convert to bytes
|
||||
elif size_str.endswith('KB'):
|
||||
result = int(float(size_str[:-2]) * 1024)
|
||||
logger.info(f"parse_size result: {result} bytes (from {size_str})")
|
||||
return result
|
||||
elif size_str.endswith('K'):
|
||||
result = int(float(size_str[:-1]) * 1024)
|
||||
logger.info(f"parse_size result: {result} bytes (from {size_str})")
|
||||
return result
|
||||
elif size_str.endswith('G') or size_str.endswith('GB'):
|
||||
# Remove 'G' or 'GB' and convert to bytes
|
||||
elif size_str.endswith('GB'):
|
||||
result = int(float(size_str[:-2]) * 1024 * 1024 * 1024)
|
||||
logger.info(f"parse_size result: {result} bytes (from {size_str})")
|
||||
return result
|
||||
elif size_str.endswith('G'):
|
||||
result = int(float(size_str[:-1]) * 1024 * 1024 * 1024)
|
||||
logger.info(f"parse_size result: {result} bytes (from {size_str})")
|
||||
return result
|
||||
|
||||
Reference in new issue
Block a user