otherwise not working after match block returns false
maxivak opened this issue · 1 comments
maxivak commented
When I use match block and otherwise, I want to skip some addresses in match so they would be caught by otherwise block. But it doesn't go to otherwise block.
RubyDNS.run_server(listen: INTERFACES, asynchronous: false) do
upstream = RubyDNS::Resolver.new([[:udp, "8.8.8.8", 53], [:tcp, "8.8.8.8", 53]])
match(/^([\d\.]+)\.in-addr\.arpa$/, IN::PTR) do |transaction, match_data|
domain = nil # just for test
if domain
transaction.respond!(Name.create(domain))
else
# Pass the request to the otherwise handler
# !!! this doesn't work
false
end
end
otherwise do |transaction|
transaction.passthrough!(upstream)
end
end
When I return false from match block - it doesn't go to otherwise block.
What am I doing wrong?
ioquatix commented
Please see the documentation here. Thanks :)