def _ignore_response_headers_rewriter(ignored_response_headers, state):
 for (name, value) in state.headers.items():
  if (name.lower() in ignored_response_headers):
   del state.headers[name]
  try:
   if isinstance(name, unicode):
    name = name.encode('ascii')
   if isinstance(value, unicode):
    value = value.encode('ascii')
  except UnicodeEncodeError:
   del state.headers[name]
  if ((set(name) - ALLOWED_HEADER_NAME_CHARACTERS) or (set(value) - ALLOWED_HEADER_VALUE_CHARACTERS)):
   del state.headers[name]

def _ignore_response_headers_rewriter ( ignored_response_headers , state ) : for ( name , value ) in state . headers . items ( ) : if ( name . lower ( ) in ignored_response_headers ) : del state . headers [ name ] try : if isinstance ( name , unicode ) : name = name . encode ( 'ascii' ) if isinstance ( value , unicode ) : value = value . encode ( 'ascii' ) except UnicodeEncodeError : del state . headers [ name ] if ( ( set ( name ) - ALLOWED_HEADER_NAME_CHARACTERS ) or ( set ( value ) - ALLOWED_HEADER_VALUE_CHARACTERS ) ) : del state . headers [ name ]
ignore specific response headers .