Changeset 106

Show
Ignore:
Timestamp:
09/02/08 22:29:10 (2 years ago)
Author:
tolsen
Message:

fix argument type conversion for digest stale option

Location:
better_httpauth/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • better_httpauth/trunk/lib/httpauth/digest.rb

    r88 r106  
    5555        #   for a WWW-Authenticate header (:challenge) or for a Authentication-Info header (:auth_info). 
    5656        def encode_directives(h, variant) 
    57           encode = {:domain => :list_to_space_quoted_string, :algorithm => false, :stale => :str_to_bool, :nc => :int_to_hex} 
     57          encode = {:domain => :list_to_space_quoted_string, :algorithm => false, :stale => :bool_to_str, :nc => :int_to_hex} 
    5858          if [:credentials, :auth].include? variant 
    5959            encode.merge! :qop => false 
     
    8989        def decode_directives(directives, variant) 
    9090          raise HTTPAuth::UnwellformedHeader.new("Can't decode directives which are nil") if directives.nil? 
    91           decode = {:domain => :space_quoted_string_to_list, :algorithm => false, :stale => :bool_to_str, :nc => :hex_to_int} 
     91          decode = {:domain => :space_quoted_string_to_list, :algorithm => false, :stale => :str_to_bool, :nc => :hex_to_int} 
    9292          if [:credentials, :auth].include? variant 
    9393            decode.merge! :qop => false 
  • better_httpauth/trunk/test/digest_credentials_test.rb

    r61 r106  
    7979      :response=>"5e7bbe24dac88a1936edf1a89cae6168", 
    8080      :cnonce=>"30b49be53eab919d", 
    81       :qop=>"auth" 
     81      :qop=>"auth", 
     82      :stale => false 
    8283    assert credentials.validate({}) 
    8384  end