From 0d8c49c3855ed22f29e075e8d79ddbab0597477d Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Mon, 3 Aug 2020 13:11:37 +0800 Subject: [PATCH] DEV: Remove unnecessary rack patches. PRs have all been merged. --- lib/freedom_patches/rack_patches.rb | 44 ----------------------------- 1 file changed, 44 deletions(-) delete mode 100644 lib/freedom_patches/rack_patches.rb diff --git a/lib/freedom_patches/rack_patches.rb b/lib/freedom_patches/rack_patches.rb deleted file mode 100644 index 6443e4b9b63..00000000000 --- a/lib/freedom_patches/rack_patches.rb +++ /dev/null @@ -1,44 +0,0 @@ -# frozen_string_literal: true - -# patch https://github.com/rack/rack/pull/600 -# -class Rack::ETag - private - - def digest_body(body) - parts = [] - has_body = false - - body.each do |part| - parts << part - has_body ||= part.length > 0 - end - - hexdigest = - if has_body - digest = Digest::MD5.new - parts.each { |part| digest << part } - digest.hexdigest - end - - [hexdigest, parts] - end -end - -# patch https://github.com/rack/rack/pull/596 -# -class Rack::ConditionalGet - private - def to_rfc2822(since) - # shortest possible valid date is the obsolete: 1 Nov 97 09:55 A - # anything shorter is invalid, this avoids exceptions for common cases - # most common being the empty string - if since && since.length >= 16 - # NOTE: there is no trivial way to write this in a non execption way - # _rfc2822 returns a hash but is not that usable - Time.rfc2822(since) rescue nil - else - nil - end - end -end