made length check on copy PUTs simpler

This commit is contained in:
John Dickinson 2010-10-26 10:13:14 -05:00
parent 95b189264c
commit 0065859bd8
1 changed files with 1 additions and 4 deletions

View File

@ -100,10 +100,7 @@ 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):
if 'X-Copy-From' in req.headers and req.content_length:
return HTTPBadRequest(body='Copy requests require a zero byte body',
request=req, content_type='text/plain')
if len(object_name) > MAX_OBJECT_NAME_LENGTH: