Skip to content

Commit 2d9921b

Browse files
authored
Merge pull request #581 from janko/ruby-2-7-compatibility
Ruby 2.7 compatibility
2 parents 8a236fe + a0b2298 commit 2d9921b

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

lib/http/connection.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def readpartial(size = BUFFER_SIZE)
9393
chunk = @parser.read(size)
9494
finish_response if finished
9595

96-
chunk.to_s
96+
chunk || "".b
9797
end
9898

9999
# Reads data from socket up until headers are loaded

lib/http/features/auto_deflate.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module Features
1010
class AutoDeflate < Feature
1111
attr_reader :method
1212

13-
def initialize(*)
13+
def initialize(**)
1414
super
1515

1616
@method = @opts.key?(:method) ? @opts[:method].to_s : "gzip"

lib/http/options.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def features=(features)
111111
unless (feature = self.class.available_features[name])
112112
argument_error! "Unsupported feature: #{name}"
113113
end
114-
feature.new(opts_or_feature)
114+
feature.new(**opts_or_feature)
115115
end
116116
end
117117
end

0 commit comments

Comments
 (0)