added check for non-zero byte bodies in copy requests
This commit is contained in:
parent
9b299b94b4
commit
740a9ba774
@ -100,6 +100,12 @@ def check_object_creation(req, object_name):
|
||||
if req.content_length is None and \
|
||||
req.headers.get('transfer-encoding') != 'chunked':
|
||||
return HTTPLengthRequired(request=req)
|
||||
if ((req.method == 'COPY' or
|
||||
(req.method == 'PUT' and 'X-Copy-From' in req.headers)) and
|
||||
req.headers.get('transfer-encoding') != 'chunked' and
|
||||
req.content_length > 0):
|
||||
return HTTPBadRequest(body='Copy requests require a zero byte body',
|
||||
request=req, content_type='text/plain')
|
||||
if len(object_name) > MAX_OBJECT_NAME_LENGTH:
|
||||
return HTTPBadRequest(body='Object name length of %d longer than %d' %
|
||||
(len(object_name), MAX_OBJECT_NAME_LENGTH), request=req,
|
||||
|
Loading…
Reference in New Issue
Block a user