def _parseHeader(h, v):
 if (h in ('passporturls', 'authentication-info', 'www-authenticate')):
  v = v.replace('Passport1.4', '').lstrip()
  fields = {}
  for fieldPair in v.split(','):
   try:
    (field, value) = fieldPair.split('=', 1)
    fields[field.lower()] = value
   except ValueError:
    fields[field.lower()] = ''
  return fields
 else:
  return v

def _parseHeader ( h , v ) : if ( h in ( 'passporturls' , 'authentication-info' , 'www-authenticate' ) ) : v = v . replace ( 'Passport1.4' , '' ) . lstrip ( ) fields = { } for fieldPair in v . split ( ',' ) : try : ( field , value ) = fieldPair . split ( '=' , 1 ) fields [ field . lower ( ) ] = value except ValueError : fields [ field . lower ( ) ] = '' return fields else : return v
split a certin number of known header values with the format: field1=val .