Sha256: 81dd28b2b266a63e644b6ddfb5736ed9df6df54e2776e892343a08ab6112bd61
Contents?: true
Size: 619 Bytes
Versions: 8
Compression:
Stored size: 619 Bytes
Contents
module Rack class Response def cookies cookie_key_value_array.each_with_object({}) do |cookie_data_hash, cookies| name, value = *cookie_data_hash.delete_at(0) data = cookie_data(cookie_data_hash) cookies[name] = { value: value }.merge(data) end end def cookie_data(cookie_data_hash) cookie_data_hash.collect { |key, assigned_data| [key.to_sym, assigned_data] }.to_h end def cookie_key_value_array value = header['Set-Cookie'] || '' value.lines.collect { |line| Rack::Utils.unescape(line).scan(%r{([\.\w]+)=([\|\.\w/]+)}) } end end end
Version data entries
8 entries across 8 versions & 1 rubygems