diff options
-rw-r--r-- | lib/rack/auth/digest/nonce.rb | 4 | ||||
-rw-r--r-- | lib/rack/response.rb | 7 | ||||
-rw-r--r-- | lib/rack/simple_body_proxy.rb | 13 |
3 files changed, 3 insertions, 21 deletions
diff --git a/lib/rack/auth/digest/nonce.rb b/lib/rack/auth/digest/nonce.rb index 6c1f28a3..089bb6f4 100644 --- a/lib/rack/auth/digest/nonce.rb +++ b/lib/rack/auth/digest/nonce.rb @@ -28,11 +28,11 @@ module Rack end def to_s - [([ @timestamp, digest ] * ' ')].pack("m*").strip + ["#{@timestamp} #{digest}"].pack("m*").strip end def digest - ::Digest::MD5.hexdigest([ @timestamp, self.class.private_key ] * ':') + ::Digest::MD5.hexdigest("#{@timestamp}:#{self.class.private_key}") end def valid? diff --git a/lib/rack/response.rb b/lib/rack/response.rb index 2e548cde..58f9e5d6 100644 --- a/lib/rack/response.rb +++ b/lib/rack/response.rb @@ -3,7 +3,6 @@ require 'rack/request' require 'rack/utils' require 'rack/body_proxy' -require 'rack/simple_body_proxy' require 'rack/media_type' require 'time' @@ -73,11 +72,7 @@ module Rack close [status.to_i, header, []] else - if @block.nil? - [status.to_i, header, SimpleBodyProxy.new(@body)] - else - [status.to_i, header, BodyProxy.new(self){}] - end + [status.to_i, header, BodyProxy.new(self){}] end end alias to_a finish # For *response diff --git a/lib/rack/simple_body_proxy.rb b/lib/rack/simple_body_proxy.rb deleted file mode 100644 index fe007c4c..00000000 --- a/lib/rack/simple_body_proxy.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -module Rack - class SimpleBodyProxy - def initialize(body) - @body = body - end - - def each(&blk) - @body.each(&blk) - end - end -end |