Skip to content

Commit

Permalink
Merge pull request socketry#7 in EB/async-dns from bugfix/nlo/EB1-190…
Browse files Browse the repository at this point in the history
…7-dns-forwarding-query-upstream-fails-due-encoding-error to eblocker

* commit '1cf8843514dd236901a4d281b9132cf960f24156':
  [EB1-1907] Workaround for ruby's (< 2.3) object.inspect bug triggered by queries containing UTF-8 encoded characters.
  • Loading branch information
Markus Jansen committed Sep 26, 2018
2 parents d194feb + 1cf8843 commit 998d061
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lib/async/dns/resolver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,11 @@ def dispatch_request(message, options, task: Async::Task.current)
request = Request.new(message, endpoints)

request.each do |endpoint|
@logger.debug "[#{message.id}] Sending request #{message.question.inspect} to address #{endpoint.inspect}" if @logger
begin
@logger.debug "[#{message.id}] Sending request #{message.question.inspect} to address #{endpoint.inspect}" if @logger
rescue Encoding::CompatibilityError
@logger.debug "[#{message.id}] failed to log message question via inspect due to Encoding::CompatibilityError on ruby #{RUBY_VERSION}. Fixed in ruby >= 2.3" if @logger
end

begin
ip = endpoint.address.ip_address
Expand Down
2 changes: 1 addition & 1 deletion lib/async/dns/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@

module Async
module DNS
VERSION = '1.0.1'
VERSION = '1.0.2'
end
end

0 comments on commit 998d061

Please sign in to comment.