def parse_www_authenticate_header(value, on_update=None):
 if (not value):
  return WWWAuthenticate(on_update=on_update)
 try:
  (auth_type, auth_info) = value.split(None, 1)
  auth_type = auth_type.lower()
 except (ValueError, AttributeError):
  return WWWAuthenticate(value.strip().lower(), on_update=on_update)
 return WWWAuthenticate(auth_type, parse_dict_header(auth_info), on_update)

def parse_www_authenticate_header ( value , on_update = None ) : if ( not value ) : return WWWAuthenticate ( on_update = on_update ) try : ( auth_type , auth_info ) = value . split ( None , 1 ) auth_type = auth_type . lower ( ) except ( ValueError , AttributeError ) : return WWWAuthenticate ( value . strip ( ) . lower ( ) , on_update = on_update ) return WWWAuthenticate ( auth_type , parse_dict_header ( auth_info ) , on_update )
parse an http www-authenticate header into a :class:~werkzeug .