You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When searching by IP, correct results for an IP address should be returned.
Actual behavior
Incorrect results are returned if there is, for example, a carriage return character at the end of the string. Thus the search function should sanitize the input and strip invalid characters from the string.
Steps to reproduce
pry(main)> ip = '77.251.213.1'
pry(main)> search = Geocoder.search(ip)
[
[0] #<Geocoder::Result::IpinfoIo:0x0000ffffa9da69f8 @data={"ip"=>"77.251.213.1", "hostname"=>"dhcp-077-251-213-001.chello.nl", "city"=>"Amsterdam", "region"=>"North Holland", "country"=>"NL", "loc"=>"52.3740,4.8897", "org"=>"AS33915 Vodafone Libertel B.V.", "postal"=>"1012", "timezone"=>"Europe/Amsterdam", "readme"=>"https://ipinfo.io/missingauth"}, @cache_hit=nil>
]
pry(main)> ip = "77.251.213.1\n"
Geocoding API's response was not valid JSON
[]
I think the solution is to fix Geocoder::Query.sanitized_text() - should I make a PR for this?
Environment info
Geocoder version: 1.8.2
Rails version: 7.1
Database (if applicable):
Lookup (if applicable):
The text was updated successfully, but these errors were encountered:
opensourceame
changed the title
Search by should sanitize the input
Search by IP should sanitize the input
Sep 3, 2024
Expected behavior
When searching by IP, correct results for an IP address should be returned.
Actual behavior
Incorrect results are returned if there is, for example, a carriage return character at the end of the string. Thus the search function should sanitize the input and strip invalid characters from the string.
Steps to reproduce
I think the solution is to fix
Geocoder::Query.sanitized_text()
- should I make a PR for this?Environment info
The text was updated successfully, but these errors were encountered: