8000 Remove `Sinatra::Cookies` (sinatra-contrib helper)? · Issue #2034 · sinatra/sinatra · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Remove Sinatra::Cookies (sinatra-contrib helper)? #2034
Open
@dentarg

Description

@dentarg

This code: https://github.com/sinatra/sinatra/blob/v4.0.0/sinatra-contrib/lib/sinatra/cookies.rb

Or give it some love?

Do we need to do this? Isn't Rack doing this?

def parse_response
cookies_from_response = Array(@response['Set-Cookie'])
return if @response_array == cookies_from_response
hash = {}
cookies_from_response.each do |line|
key, value = line.split(';', 2).first.to_s.split('=', 2)
next if key.nil?
key = Rack::Utils.unescape(key)
if line =~ /expires=Thu, 01[-\s]Jan[-\s]1970/
@deleted << key
else
@deleted.delete key
hash[key] = value
end
end
@response_hash.replace hash
@response_array = cookies_from_response
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0