Use the old checksum header for compatibility with older clients.

This commit is contained in:
Jake Moshenko 2014-06-11 22:00:37 -04:00
parent f29d3a9180
commit 22bb1dc8cc

View file

@ -229,8 +229,7 @@ def put_image_checksum(namespace, repository, image_id):
if not permission.can():
abort(403)
checksum = (request.headers.get('X-Docker-Checksum-Payload', None) or
request.headers.get('X-Docker-Checksum'))
checksum = request.headers.get('X-Docker-Checksum')
if not checksum:
abort(400, "Missing checksum for image %(image_id)s", issue='missing-checksum',
image_id=image_id)
@ -260,7 +259,7 @@ def put_image_checksum(namespace, repository, image_id):
if checksum not in session.get('checksum', []):
logger.debug('session checksums: %s' % session.get('checksum', []))
logger.debug('client supplied checksum: %s' % checksum)
logger.debug('put_image_layer: Wrong checksum')
logger.debug('put_image_checksum: Wrong checksum')
abort(400, 'Checksum mismatch for image: %(image_id)s',
issue='checksum-mismatch', image_id=image_id)