diff options
author | Thibaut Girka <thib@sitedethib.com> | 2019-07-07 13:49:31 +0200 |
---|---|---|
committer | Thibaut Girka <thib@sitedethib.com> | 2019-07-07 13:49:31 +0200 |
commit | 7039dca12cf926fecbb2eb4fbba1461af5cb91c2 (patch) | |
tree | e530d7d18cd36177015c3fc840aaea68a6d723fa /app/lib | |
parent | 47c30be8d810fd6d5d27285a097d01843f4dd9f6 (diff) | |
parent | c07cca4727041ea5a5721acbc603d4bfb45a15a6 (diff) |
Merge commit 'c07cca4727041ea5a5721acbc603d4bfb45a15a6' into glitch-soc/merge-upstream
Unlike upstream, kept the direct timeline endpoint, as it is still of use in glitch-soc.
Diffstat (limited to 'app/lib')
-rw-r--r-- | app/lib/request.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/lib/request.rb b/app/lib/request.rb index af49d6c77..e25b9026c 100644 --- a/app/lib/request.rb +++ b/app/lib/request.rb @@ -191,7 +191,7 @@ class Request begin raise Mastodon::HostValidationError if PrivateAddressCheck.private_address?(IPAddr.new(address.to_s)) - sock = ::Socket.new(::Socket::AF_INET, ::Socket::SOCK_STREAM, 0) + sock = ::Socket.new(address.is_a?(Resolv::IPv6) ? ::Socket::AF_INET6 : ::Socket::AF_INET, ::Socket::SOCK_STREAM, 0) sockaddr = ::Socket.pack_sockaddr_in(port, address.to_s) sock.setsockopt(::Socket::IPPROTO_TCP, ::Socket::TCP_NODELAY, 1) |