def retrieve_cors_header(response, key):
 headers = response.get_headers()
 for header_name in headers:
  if (header_name.upper().strip() == key.upper()):
   return headers[header_name].strip()
 return None

def retrieve_cors_header ( response , key ) : headers = response . get_headers ( ) for header_name in headers : if ( header_name . upper ( ) . strip ( ) == key . upper ( ) ) : return headers [ header_name ] . strip ( ) return None
method to retrieve a cors header value from a http response .