Rust Version Compatibility for update Protocol msg

and diff patch
This commit is contained in:
canewsin 2022-04-08 23:12:10 +05:30
parent 02ceb70a4f
commit 00db9c9f87
2 changed files with 6 additions and 0 deletions

View File

@ -134,6 +134,10 @@ class FileRequest(object):
if should_validate_content:
try:
if type(body) is str:
body = body.encode()
# elif type(body) is list:
# content = json.loads(bytes(list).decode())
content = json.loads(body.decode())
except Exception as err:
site.log.debug("Update for %s is invalid JSON: %s" % (inner_path, err))

View File

@ -42,6 +42,8 @@ def patch(old_f, actions):
continue
elif action == "+": # Add lines
for add_line in param:
if type(add_line) is str:
add_line = add_line.encode()
new_f.write(add_line)
else:
raise "Unknown action: %s" % action