Skip to content
Snippets Groups Projects
Commit 5142c617 authored by Yorick Peterse's avatar Yorick Peterse
Browse files

Cast values to strings before escaping them

This ensures that e.g. line numbers used in tags are first casted to
strings.
parent 9f95ff0d
No related branches found
No related tags found
1 merge request!2042Storing of application metrics in InfluxDB
Loading
Loading
@@ -24,6 +24,6 @@ class MetricsWorker
end
 
def escape_value(value)
value.gsub('=', '\\=')
value.to_s.gsub('=', '\\=')
end
end
Loading
Loading
@@ -36,5 +36,9 @@ describe MetricsWorker do
it 'escapes an equals sign' do
expect(worker.escape_value('foo=')).to eq('foo\\=')
end
it 'casts values to Strings' do
expect(worker.escape_value(10)).to eq('10')
end
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment