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