def scrub_headers(headers):
 if isinstance(headers, dict):
  headers = headers.items()
 headers = [(parse_header_string(key), parse_header_string(val)) for (key, val) in headers]
 if (not logger_settings.get('redact_sensitive_headers', True)):
  return dict(headers)
 if (logger_settings.get('reveal_sensitive_prefix', 16) < 0):
  logger_settings['reveal_sensitive_prefix'] = 16
 return {key: safe_value(key, val) for (key, val) in headers}

def scrub_headers ( headers ) : if isinstance ( headers , dict ) : headers = headers . items ( ) headers = [ ( parse_header_string ( key ) , parse_header_string ( val ) ) for ( key , val ) in headers ] if ( not logger_settings . get ( 'redact_sensitive_headers' , True ) ) : return dict ( headers ) if ( logger_settings . get ( 'reveal_sensitive_prefix' , 16 ) < 0 ) : logger_settings [ 'reveal_sensitive_prefix' ] = 16 return { key : safe_value ( key , val ) for ( key , val ) in headers }
redact header values that can contain sensitive information that should not be logged .