Fix bigfile upload post request return value

This commit is contained in:
shortcutme 2019-03-23 03:38:04 +01:00
parent a82ee338ef
commit e24d1016a5
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE

View file

@ -7,6 +7,7 @@ import math
import warnings import warnings
import base64 import base64
import binascii import binascii
import json
import gevent import gevent
import gevent.lock import gevent.lock
@ -43,6 +44,7 @@ class UiRequestPlugin(object):
else: else:
return super(UiRequestPlugin, self).isCorsAllowed(path) return super(UiRequestPlugin, self).isCorsAllowed(path)
@helper.encodeResponse
def actionBigfileUpload(self): def actionBigfileUpload(self):
nonce = self.get.get("upload_nonce") nonce = self.get.get("upload_nonce")
if nonce not in upload_nonces: if nonce not in upload_nonces:
@ -102,12 +104,12 @@ class UiRequestPlugin(object):
site.content_manager.contents.loadItem(file_info["content_inner_path"]) # reload cache site.content_manager.contents.loadItem(file_info["content_inner_path"]) # reload cache
return { return json.dumps({
"merkle_root": merkle_root, "merkle_root": merkle_root,
"piece_num": len(piecemap_info["sha512_pieces"]), "piece_num": len(piecemap_info["sha512_pieces"]),
"piece_size": piece_size, "piece_size": piece_size,
"inner_path": inner_path "inner_path": inner_path
} })
def readMultipartHeaders(self, wsgi_input): def readMultipartHeaders(self, wsgi_input):
for i in range(100): for i in range(100):