From 62b69eb133b18265bdd1128114ac95cfc8c72966 Mon Sep 17 00:00:00 2001 From: evazion Date: Sun, 13 Dec 2020 03:38:07 -0600 Subject: [PATCH] gems: upgrade http-cookie to fix Rails 6.1 bug. Upgrade the http-cookie gem to a personal fork containing a bugfix for a http-cookie bug that is triggered by Rails 6.1. The bug is that HTTP::Cookie objects raise an exception if they're compared against non-cookie objects. This bug gets triggered when the Nijie source strategy calls `Rails.cache.fetch` to cache the Nijie login cookie. `Rails.cache.fetch` ends up calling ActiveSupport::Cache::Store::Entry#dup_value!, which compares the cookie with `true`, which triggers the exception. The http-cookie gem hasn't been updated for 4 years, so we're stuck patching the library ourselves. --- Gemfile | 1 + Gemfile.lock | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index 9f109c6ae..1aef4acc1 100644 --- a/Gemfile +++ b/Gemfile @@ -41,6 +41,7 @@ gem 'scenic' gem 'ipaddress_2' gem 'http' gem 'activerecord-hierarchical_query' +gem 'http-cookie', git: "https://github.com/danbooru/http-cookie" gem 'pundit' gem 'mail' gem 'nokogiri' diff --git a/Gemfile.lock b/Gemfile.lock index 66cc5f2ca..e93fe7071 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,3 +1,10 @@ +GIT + remote: https://github.com/danbooru/http-cookie + revision: 382d8a641e4df226e0e7b0d2bfaeadb2fe71dd84 + specs: + http-cookie (1.0.4) + domain_name (~> 0.5) + GIT remote: https://github.com/evazion/dtext_rb.git revision: a95bf1d537cbdba4585adb8e123f03f001f56fd7 @@ -161,8 +168,6 @@ GEM http-cookie (~> 1.0) http-form_data (~> 2.2) http-parser (~> 1.2.0) - http-cookie (1.0.3) - domain_name (~> 0.5) http-form_data (2.3.0) http-parser (1.2.2) ffi-compiler @@ -405,6 +410,7 @@ DEPENDENCIES ffaker flamegraph http + http-cookie! ipaddress_2 listen mail