Skip to content

Commit

Permalink
do not show IDN message for normal ascii hostnames
Browse files Browse the repository at this point in the history
  • Loading branch information
HoneyryderChuck committed Nov 19, 2020
1 parent 777ab21 commit c8663e5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ And also:
* HTTP/2 Server Push
* H2C Upgrade
* Automatic follow redirects
* International Domain Names

## How

Expand Down
4 changes: 1 addition & 3 deletions lib/httpx/resolver/https.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,7 @@ def resolve(connection = @connections.first, hostname = nil)

if hostname.nil?
hostname = connection.origin.host
if hostname != connection.origin.non_ascii_hostname
log { "resolver: resolve IDN #{connection.origin.non_ascii_hostname} as #{hostname}" }
end
log { "resolver: resolve IDN #{connection.origin.non_ascii_hostname} as #{hostname}" } if connection.origin.non_ascii_hostname
end
type = @_record_types[hostname].first
log { "resolver: query #{type} for #{hostname}" }
Expand Down
4 changes: 1 addition & 3 deletions lib/httpx/resolver/native.rb
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,7 @@ def resolve(connection = @connections.first, hostname = nil)

if hostname.nil?
hostname = connection.origin.host
if hostname != connection.origin.non_ascii_hostname
log { "resolver: resolve IDN #{connection.origin.non_ascii_hostname} as #{hostname}" }
end
log { "resolver: resolve IDN #{connection.origin.non_ascii_hostname} as #{hostname}" } if connection.origin.non_ascii_hostname
end
@queries[hostname] = connection
type = @_record_types[hostname].first
Expand Down

0 comments on commit c8663e5

Please sign in to comment.