Skip to content
Snippets Groups Projects
Commit d701e04e authored by Brian Ewell's avatar Brian Ewell
Browse files

Altered the Geocoder#ip_address? method to recognize IP addresses prefixed...

Altered the Geocoder#ip_address? method to recognize IP addresses prefixed with ::ffff: as is common with webservers binding to ipv6 sockets
parent 8a5c8df4
No related branches found
No related tags found
No related merge requests found
......@@ -115,7 +115,7 @@ module Geocoder
# 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
##
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment