update code
This commit is contained in:
4
file.py
4
file.py
@@ -25,7 +25,7 @@ class BaseFileManager(ABC):
|
||||
if headers is None:
|
||||
headers = {}
|
||||
resp = requests.put(url, data=raw, headers=headers)
|
||||
if resp.status_code != 201:
|
||||
if resp.status_code != 201 or resp.status_code != 200:
|
||||
return {}
|
||||
return resp.json()
|
||||
|
||||
@@ -146,7 +146,7 @@ class LocalFileManager(BaseFileManager):
|
||||
@staticmethod
|
||||
def _write(file_path: str, file_content: bytes):
|
||||
try:
|
||||
with open(file_path, "wb", encoding="utf-8") as f:
|
||||
with open(file_path, "wb") as f:
|
||||
f.write(file_content)
|
||||
return True
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user