Commit 737c1a75 authored by Sofia Papagiannaki's avatar Sofia Papagiannaki

pithos: Catch malformed X-Object-Source

Raise 400 (Bad Request) if the server fails to parse it.
parent bbfb8fbe
......@@ -1362,9 +1362,13 @@ def object_update(request, v_account, v_container, v_object):
src_account = request.META.get('HTTP_X_SOURCE_ACCOUNT')
if not src_account:
src_account = request.user_uniq
src_container, src_name = split_container_object_string(src_object)
src_version = request.META.get('HTTP_X_SOURCE_VERSION')
try:
src_container, src_name = split_container_object_string(src_object)
except ValueError:
raise faults.BadRequest('Invalid source object')
try:
src_version = request.META.get('HTTP_X_SOURCE_VERSION')
src_size, src_hashmap = request.backend.get_object_hashmap(
request.user_uniq,
src_account, src_container, src_name, src_version)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment