def extract_client_header():
 rewrited_headers = {}
 dbgprint('BrowserRequestHeaders:', request.headers)
 for (head_name, head_value) in request.headers:
  head_name_l = head_name.lower()
  if (head_name_l in ('host', 'content-length')):
   continue
  elif ((head_name_l == 'content-type') and (head_value == '')):
   continue
  elif ((head_name_l == 'accept-encoding') and (('br' in head_value) or ('sdch' in head_value))):
   _str_buff = ''
   if ('gzip' in head_value):
    _str_buff += 'gzip, '
   if ('deflate' in head_value):
    _str_buff += 'deflate'
   if _str_buff:
    rewrited_headers[head_name_l] = _str_buff
   continue
  else:
   rewrited_headers[head_name_l] = client_requests_text_rewrite(head_value)
   if (head_name_l == 'cookie'):
    rewrited_headers[head_name_l] = regex_remove__zmirror_verify__header.sub('', rewrited_headers[head_name_l])
 dbgprint('FilteredBrowserRequestHeaders:', rewrited_headers)
 return rewrited_headers

def extract_client_header ( ) : rewrited_headers = { } dbgprint ( 'BrowserRequestHeaders:' , request . headers ) for ( head_name , head_value ) in request . headers : head_name_l = head_name . lower ( ) if ( head_name_l in ( 'host' , 'content-length' ) ) : continue elif ( ( head_name_l == 'content-type' ) and ( head_value == '' ) ) : continue elif ( ( head_name_l == 'accept-encoding' ) and ( ( 'br' in head_value ) or ( 'sdch' in head_value ) ) ) : _str_buff = '' if ( 'gzip' in head_value ) : _str_buff += 'gzip, ' if ( 'deflate' in head_value ) : _str_buff += 'deflate' if _str_buff : rewrited_headers [ head_name_l ] = _str_buff continue else : rewrited_headers [ head_name_l ] = client_requests_text_rewrite ( head_value ) if ( head_name_l == 'cookie' ) : rewrited_headers [ head_name_l ] = regex_remove__zmirror_verify__header . sub ( '' , rewrited_headers [ head_name_l ] ) dbgprint ( 'FilteredBrowserRequestHeaders:' , rewrited_headers ) return rewrited_headers
extract necessary client header .