We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ec2f034 commit 95eeabaCopy full SHA for 95eeaba
lib/geocoder/query.rb
@@ -23,7 +23,7 @@ def sanitized_text
23
text.split(/\s*,\s*/).join(',')
24
end
25
else
26
- text
+ text.strip
27
28
29
test/unit/query_test.rb
@@ -16,6 +16,12 @@ def test_detect_non_ip_address
16
assert !Geocoder::Query.new("::ffff:123.456.789").ip_address?
17
18
19
+ def test_strip_trailing_whitespace_for_ip_address_query
20
+ text = "77.251.213.1\n"
21
+ query = Geocoder::Query.new(text)
22
+ assert_equal text[0...-1], query.sanitized_text
+ end
+
def test_blank_query_detection
assert Geocoder::Query.new(nil).blank?
assert Geocoder::Query.new("").blank?
0 commit comments