tell me if this works:

    request.path.replace('/addon/' + addon_id, '/addon/' + addon.slug)