Skip to content

Commit efad822

Browse files
author
Daniel Magliola
authored
Merge pull request #188 from prometheus/remove_deprecated_escaping
Remove call to deprecated `URI.escape`
2 parents 23418c2 + f31bdcb commit efad822

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/prometheus/client/push.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ def parse(url)
6666

6767
def build_path(job, instance)
6868
if instance
69-
format(INSTANCE_PATH, URI.escape(job), URI.escape(instance))
69+
format(INSTANCE_PATH, CGI::escape(job), CGI::escape(instance))
7070
else
71-
format(PATH, URI.escape(job))
71+
format(PATH, CGI::escape(job))
7272
end
7373
end
7474

spec/prometheus/client/push_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
it 'escapes non-URL characters' do
7474
push = Prometheus::Client::Push.new('bar job', 'foo <my instance>')
7575

76-
expected = '/metrics/job/bar%20job/instance/foo%20%3Cmy%20instance%3E'
76+
expected = '/metrics/job/bar+job/instance/foo+%3Cmy+instance%3E'
7777
expect(push.path).to eql(expected)
7878
end
7979
end

0 commit comments

Comments
 (0)