From 2c220f44dd4220685d052887e53d0453bcc3c194 Mon Sep 17 00:00:00 2001 From: Akinori MUSHA Date: Mon, 7 Jun 2021 14:44:18 +0900 Subject: [PATCH] Allow aliases because YAML.dump generates aliases when it sees multiple occurrences of an object --- lib/http/cookie_jar/yaml_saver.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/http/cookie_jar/yaml_saver.rb b/lib/http/cookie_jar/yaml_saver.rb index 532e598..bc83f04 100644 --- a/lib/http/cookie_jar/yaml_saver.rb +++ b/lib/http/cookie_jar/yaml_saver.rb @@ -76,7 +76,7 @@ class HTTP::CookieJar::YAMLSaver < HTTP::CookieJar::AbstractSaver if YAML.name == 'Psych' && Psych::VERSION >= '3.1' def load_yaml(yaml) - YAML.safe_load(yaml, :permitted_classes => %w[Time HTTP::Cookie Mechanize::Cookie DomainName]) + YAML.safe_load(yaml, :permitted_classes => %w[Time HTTP::Cookie Mechanize::Cookie DomainName], :aliases => true) end else def load_yaml(yaml)