

def valid_timestamp(request):
    '\n    Helper function to extract a timestamp from requests that require one.\n\n    :param request: the swob request object\n\n    :returns: a valid Timestamp instance\n    :raises: HTTPBadRequest on missing or invalid X-Timestamp\n    '
    try:
        return request.timestamp
    except exceptions.InvalidTimestamp as e:
        raise HTTPBadRequest(body=str(request), request=request, content_type='text/plain')

dataset/ETHPy150Open openstack/swift/swift/common/constraints.py valid_timestamp/VarMisuse@38/129 `e`->`request`