Rust Version Compatibility for update Protocol msg
and diff patch
This commit is contained in:
parent
02ceb70a4f
commit
00db9c9f87
2 changed files with 6 additions and 0 deletions
|
@ -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))
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue