fix README.md

This commit is contained in:
jxxghp
2024-03-16 18:28:09 +08:00
parent 550fe26d76
commit f345d94009
2 changed files with 10 additions and 5 deletions

View File

@ -14,6 +14,8 @@ from app.utils.common import get_decrypted_cookie_data
class GzipRequest(Request):
_body: bytes = b""
async def body(self) -> bytes:
if not hasattr(self, "_body"):
body = await super().body()
@ -66,10 +68,9 @@ async def update_cookie(req: schemas.CookieData):
content = json.dumps({"encrypted": req.encrypted})
with open(file_path, encoding="utf-8", mode="w") as file:
file.write(content)
read_content = None
with open(file_path, encoding="utf-8", mode="r") as file:
read_content = file.read()
if (read_content == content):
if read_content == content:
return {"action": "done"}
else:
return {"action": "error"}