diff --git a/lib/http/connection.rb b/lib/http/connection.rb index 0e9082a1..3e53c80f 100644 --- a/lib/http/connection.rb +++ b/lib/http/connection.rb @@ -93,7 +93,7 @@ def readpartial(size = BUFFER_SIZE) chunk = @parser.read(size) finish_response if finished - chunk.to_s + chunk || "".b end # Reads data from socket up until headers are loaded diff --git a/lib/http/features/auto_deflate.rb b/lib/http/features/auto_deflate.rb index 4b9b75c3..ff1b9259 100644 --- a/lib/http/features/auto_deflate.rb +++ b/lib/http/features/auto_deflate.rb @@ -10,7 +10,7 @@ module Features class AutoDeflate < Feature attr_reader :method - def initialize(*) + def initialize(**) super @method = @opts.key?(:method) ? @opts[:method].to_s : "gzip" diff --git a/lib/http/options.rb b/lib/http/options.rb index 1bf166e3..65f40aa2 100644 --- a/lib/http/options.rb +++ b/lib/http/options.rb @@ -111,7 +111,7 @@ def features=(features) unless (feature = self.class.available_features[name]) argument_error! "Unsupported feature: #{name}" end - feature.new(opts_or_feature) + feature.new(**opts_or_feature) end end end