Skip to content

Commit 24ba8a6

Browse files
mikecarltonmax-ipinfo
authored andcommitted
Fix request_details in isBogon case
The hash 'details' is assigned to before creation, leading to ``` undefined method `[]=' for #<IPinfo::Response:0x...> ```
1 parent 6a949d3 commit 24ba8a6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/ipinfo.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ def prepare_http_client(httpc = nil)
119119

120120
def request_details(ip_address = nil, host_type)
121121
if isBogon(ip_address)
122+
details = {}
122123
details[:ip] = ip_address
123124
details[:bogon] = true
124125
details[:ip_address] = IPAddr.new(ip_address)

0 commit comments

Comments
 (0)