lib/oo_auth/request_proxy.rb
def parse(header)
        header = header.to_s
        return unless header.start_with?('OAuth ')
        # decompose
        header[6, header.length].split(',').inject({}) do |hsh, str|
          key, value = str.split('=').map { |s| OoAuth.unescape(s.strip) }
          if PARAMETERS.include?(key)
            hsh[key] = value.sub(/^\"(.*)\"$/, '\1')
          end
          hsh
        end
      end
# Parse an Authorization / WWW-Authenticate header into a hash. Takes care of unescaping and
# removing surrounding quotes. Raises a OAuth::Problem if the header is not parsable into a
# valid hash. Does not validate the keys or values.
#
#   hash = parse(headers['Authorization'] || headers['WWW-Authenticate'])
#   hash['oauth_timestamp']
#     #=>"1234567890"
#
Parse an Authorization / WWW-Authenticate header into a hash. Takes care of unescaping and
removing surrounding quotes. Raises a OAuth::Problem if the header is not parsable into a
valid hash. Does not validate the keys or values.


Parse an Authorization / WWW - Authenticate header into a hash . Takes care of unescaping and removing surrounding quotes . Raises a OAuth :: Problem if the header is not parsable into a valid hash . Does not validate the keys or values .
def parse(header)
        header = header.to_s
        return unless header.start_with?('OAuth ')
        header[6, header.length].split(',').inject({}) do |hsh, str|
          key, value = str.split('=').map { |s| OoAuth.unescape(s.strip) }
          if PARAMETERS.include?(key)
            hsh[key] = value.sub(/^\"(.*)\"$/, '\1')
          end
          hsh
        end
      end
def parse ( header ) header = header . to_s return unless header . start_with? ( 'OAuth ' ) header [ 6 , header . length ] . split ( ',' ) . inject ( { } ) do | hsh , str | key , value = str . split ( '=' ) . map { | s | OoAuth . unescape ( s . strip ) } if PARAMETERS . include? ( key ) hsh [ key ] = value . sub ( / ^ \" (.*) \" $ / , '\1' ) end hsh end end
Parse an Authorization / WWW-Authenticate header into a hash.
Parse an Authorization / WWW - Authenticate header into a hash .
# decompose
header