'Make sure that X-Object-Manifest is valid if present.'

def _validate_x_object_manifest_header(self, req):

    if ('X-Object-Manifest' in req.headers):
        value = req.headers['X-Object-Manifest']
        container = prefix = None
        try:
            (container, prefix) = value.split('/', 1)
        except ValueError:
            pass
        if ((not container) or (not prefix) or ('?' in value) or ('&' in value) or prefix.startswith('/')):
            return HTTPBadRequest(request=req, body='X-Object-Manifest    must    be    in    the    format    container/prefix')
