Class Rufus::Verbs::DigestAuthMixin::ServerReply

  1. lib/rufus/verbs/digest.rb
Parent: Object

A common parent class for Challenge and AuthInfo. Their header parsing code is here.

Methods

public class

  1. new

protected instance

  1. parse_entry

Public class methods

new (res)
[show source]
     # File lib/rufus/verbs/digest.rb, line 188
188:       def initialize (res)
189: 
190:         s = res[header_name]
191:         return nil unless s
192: 
193:         s = s[7..-1] if s[0, 6] == "Digest"
194: 
195:         s = s.split ","
196: 
197:         s.each do |e|
198: 
199:           k, v = parse_entry e
200: 
201:           if k == 'stale'
202:             @stale = (v.downcase == 'true')
203:           elsif k == 'nc'
204:             @nc = v.to_i
205:           elsif k == 'qop'
206:             @qop = v.split ","
207:           else
208:             instance_variable_set "@#{k}".to_sym, v
209:           end
210:         end
211:       end

Protected instance methods

parse_entry (e)
[show source]
     # File lib/rufus/verbs/digest.rb, line 215
215:       def parse_entry (e)
216: 
217:         k, v = e.split '=', 2
218:         v = v[1..-2] if v[0, 1] == '"'
219:         [ k.strip, v.strip ]
220:       end