Skip to content

Commit

Permalink
rack 3 initial attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
pcai committed Feb 11, 2024
1 parent a67e021 commit 1fbe687
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ gem 'net-http-persistent', '~> 4.0', :require => false
gem 'http', :require => false

# adapter extensions
gem 'rack', '< 3'
gem 'rack', '~> 3.0'
gem 'socksify'

# coverage
Expand Down
4 changes: 2 additions & 2 deletions httpi.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Gem::Specification.new do |s|

s.license = 'MIT'

s.add_dependency 'rack', '< 3'
s.add_dependency 'rack', '~> 3.0', '< 3.1'
s.add_dependency 'nkf'
s.add_dependency 'base64'
s.add_dependency 'mutex_m'
Expand All @@ -30,7 +30,7 @@ Gem::Specification.new do |s|
s.add_development_dependency 'rake', '~> 13.0'
s.add_development_dependency 'rspec', '~> 3.5'
s.add_development_dependency 'mocha', '~> 0.13'
s.add_development_dependency 'puma', '~> 5.0'
s.add_development_dependency 'puma', '~> 6.0'
s.add_development_dependency 'webmock'

s.metadata["rubygems_mfa_required"] = "true"
Expand Down
4 changes: 2 additions & 2 deletions lib/httpi/request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ def ssl?

# Returns a Hash of HTTP headers. Defaults to return an empty Hash.
def headers
@headers ||= Rack::Utils::HeaderHash.new
@headers ||= Rack::Headers.new
end

# Sets the Hash of HTTP headers.
def headers=(headers)
@headers = Rack::Utils::HeaderHash.new(headers)
@headers = Rack::Headers.new.merge(headers)
end

# Adds a header information to accept gzipped content.
Expand Down
2 changes: 1 addition & 1 deletion lib/httpi/response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Response
# Initializer expects an HTTP response +code+, +headers+ and +body+.
def initialize(code, headers, body)
self.code = code.to_i
self.headers = Rack::Utils::HeaderHash.new(headers)
self.headers = Rack::Headers.new.merge(headers)
self.raw_body = body
end

Expand Down
2 changes: 1 addition & 1 deletion spec/integration/support/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def stop
private

def events
Puma::Events.new($stdout, $stderr)
Puma::Events.new
end

def add_tcp_listener
Expand Down

0 comments on commit 1fbe687

Please sign in to comment.