class Net::HTTPHeader::DigestAuthenticator

def parse(response_header)

def parse(response_header)
  header = response_header['www-authenticate']
  header = header.gsub(/qop=(auth(?:-int)?)/, 'qop="\\1"')
  header =~ /Digest (.*)/
  params = {}
  if $1
    non_quoted = $1.gsub(/(\w+)="(.*?)"/) { params[$1] = $2 }
    non_quoted.gsub(/(\w+)=([^,]*)/) { params[$1] = $2 }
  end
  params
end