clerk-sdk-ruby icon indicating copy to clipboard operation
clerk-sdk-ruby copied to clipboard

Rack middleware calls non-existent function for older versions of rails

Open ckeyes88 opened this issue 6 months ago • 0 comments

We came across an issue with the latest clerk-sdk-ruby where it calls a method on Rack::Utils:Modules that is only available in >2.0 versions of rack. Anyone using Rails <5 is bound to rack 1.6 which means they don't have the method parse_cookies_headers.

def set_cookie_headers!(headers, cookie_headers)
  cookie_headers.each do |cookie_header|
    cookie_key = parse_cookie_key(cookie_header)
    cookie = ::Rack::Utils.parse_cookies_header(cookie_header) # undefined method `parse_cookies_header`
    cookie_params = convert_http_cookie_to_cookie_setter_params(cookie_key, cookie)
    ::Rack::Utils.set_cookie_header!(headers, cookie_key, cookie_params)
  end
end

Image

ckeyes88 avatar Apr 16 '25 23:04 ckeyes88