Skip to content

Commit f44069d

Browse files
committed
Use new Protocol::HTTP::Peer interface.
1 parent 16a29d5 commit f44069d

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

lib/protocol/rack/adapter/generic.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,8 @@ def unwrap_request(request, env)
9090
# HTTP/2 prefers `:authority` over `host`, so we do this for backwards compatibility.
9191
env[CGI::HTTP_HOST] ||= request.authority
9292

93-
if request.respond_to?(:remote_address)
94-
if remote_address = request.remote_address
95-
env[CGI::REMOTE_ADDR] = remote_address.ip_address if remote_address.ip?
96-
end
93+
if peer = request.peer
94+
env[CGI::REMOTE_ADDR] = peer.ip_address
9795
end
9896
end
9997

protocol-rack.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ Gem::Specification.new do |spec|
2424

2525
spec.required_ruby_version = ">= 3.1"
2626

27-
spec.add_dependency "protocol-http", "~> 0.37"
27+
spec.add_dependency "protocol-http", "~> 0.43"
2828
spec.add_dependency "rack", ">= 1.0"
2929
end

0 commit comments

Comments
 (0)