From 69b240bc01cfb2e298210598592f9e88a21837e7 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Thu, 6 Jun 2024 11:11:17 -0400 Subject: [PATCH] fix: explicitly require CGI Closes #49 --- lib/http/cookie.rb | 1 + lib/http/cookie_jar/mozilla_store.rb | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/http/cookie.rb b/lib/http/cookie.rb index 431d926..be06148 100644 --- a/lib/http/cookie.rb +++ b/lib/http/cookie.rb @@ -6,6 +6,7 @@ require 'uri' require 'domain_name' require 'http/cookie/ruby_compat' +require 'cgi' module HTTP autoload :CookieJar, 'http/cookie_jar' diff --git a/lib/http/cookie_jar/mozilla_store.rb b/lib/http/cookie_jar/mozilla_store.rb index 03433a7..79f9167 100644 --- a/lib/http/cookie_jar/mozilla_store.rb +++ b/lib/http/cookie_jar/mozilla_store.rb @@ -400,8 +400,6 @@ def get_query_param(str, key) } end else - require 'cgi' - def encode_www_form(enum) enum.map { |k, v| "#{CGI.escape(k)}=#{CGI.escape(v)}" }.join('&') end