Skip to content

Commit 687f398

Browse files
committed
Merge pull request #214 from seancribbs/uri-handling-fixups
only accept IPv6 addresses when IPV6_MATCH matches
2 parents a04c569 + 8b30af5 commit 687f398

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

lib/webmachine/request.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def parse_host(uri, host_string)
173173
# Split host and port number from string.
174174
case host_string
175175
when IPV6_MATCH
176-
uri.host = IPAddr.new($~[:address]).to_s
176+
uri.host = IPAddr.new($~[:address], Socket::AF_INET6).to_s
177177
uri.port = $~[:port].to_i
178178
when HOST_MATCH
179179
uri.host = $~[:host]

lib/webmachine/spec/adapter_lint.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
require "webmachine/spec/test_resource"
22
require "net/http"
3-
require 'ipaddr'
43

54
shared_examples_for :adapter_lint do
65
attr_accessor :client

0 commit comments

Comments
 (0)