code: def set_cors_headers_on_response(response):
      """Add response headers."""
      allow_headers = conf.get("api", "access_control_allow_headers")
      allow_methods = conf.get("api", "access_control_allow_methods")
      allow_origins = conf.get("api", "access_control_allow_origins")
      if allow_headers:
          response.headers[
              "Access-Control-Allow-Headers"
          ] = allow_headers
      if allow_methods:
          response.headers[
              "Access-Control-Allow-Methods"
          ] = allow_methods
      if allow_origins == "*":
          response.headers["Access-Control-Allow-Origin"] = "*"
      elif allow_origins:
          allowed_origins = allow_origins.split(" ")
          origin = request.environ.get(
              "HTTP_ORIGIN", allowed_origins[0]
          )
          if origin in allowed_origins:
              response.headers["Access-Control-Allow-Origin"] = origin
      return response
  
imports: from __future__ import annotations
  import logging
  import os
  import warnings
  from functools import cached_property
  from pathlib import Path
  from typing import TYPE_CHECKING
  from connexion import FlaskApi, ProblemException, Resolver
  from connexion.decorators.validation import RequestBodyValidator
  from connexion.exceptions import BadRequestProblem
  from flask import request
  from airflow.api_connexion.exceptions import common_error_handler
  from airflow.configuration import conf
  from airflow.exceptions import RemovedInAirflow3Warning
  from airflow.security import permissions
  from airflow.utils.yaml import safe_load
  from airflow.www.extensions.init_auth_manager import get_auth_manager
label_desc: Use image node_id 5 for calling a global function with example usage: set_cors_headers_on_response(response) and returns: response