Skip to content

Commit

Permalink
Altered the Geocoder#ip_address? method to recognize IP addresses pre…
Browse files Browse the repository at this point in the history
…fixed with ::ffff: as is common with webservers binding to ipv6 sockets
  • Loading branch information
brianewell committed Mar 23, 2012
1 parent 8a5c8df commit d701e04
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/geocoder.rb
Expand Up @@ -115,7 +115,7 @@ def spawn_lookup(name)
# dot-delimited numbers.
#
def ip_address?(value)
!!value.to_s.match(/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/)
!!value.to_s.match(/^(::ffff:)?(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/)
end

##
Expand Down

0 comments on commit d701e04

Please sign in to comment.