def METHOD_NAME(config, route_name, cors_policy):
    """
    Add a view to handle CORS preflight requests for a given route.
    :param route_name: The route
    :param cors_policy: CORS policy created via a call to `policy`.
    """
    # Keep track of which routes already have preflight views registered.
    #
    # For a given route there may be multiple views with different predicates
    # (eg. to handle authenticated vs unauthenticated users). However we only
    # want one preflight view.
    if not hasattr(config.registry, "cors_preflighted_views"):
        config.registry.cors_preflighted_views = set()
    if route_name in config.registry.cors_preflighted_views:
        return
    def preflight_view(_context, _request):
        return Response()
    config.add_view(
        preflight_view,
        decorator=cors_policy,
        route_name=route_name,
        request_method="OPTIONS",
    )
    config.registry.cors_preflighted_views.add(route_name)