Skip to content

Commit

Permalink
Merge pull request #188 from prometheus/remove_deprecated_escaping
Browse files Browse the repository at this point in the history
Remove call to deprecated `URI.escape`
  • Loading branch information
Daniel Magliola authored Jun 28, 2020
2 parents 23418c2 + f31bdcb commit efad822
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/prometheus/client/push.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ def parse(url)

def build_path(job, instance)
if instance
format(INSTANCE_PATH, URI.escape(job), URI.escape(instance))
format(INSTANCE_PATH, CGI::escape(job), CGI::escape(instance))
else
format(PATH, URI.escape(job))
format(PATH, CGI::escape(job))
end
end

Expand Down
2 changes: 1 addition & 1 deletion spec/prometheus/client/push_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
it 'escapes non-URL characters' do
push = Prometheus::Client::Push.new('bar job', 'foo <my instance>')

expected = '/metrics/job/bar%20job/instance/foo%20%3Cmy%20instance%3E'
expected = '/metrics/job/bar+job/instance/foo+%3Cmy+instance%3E'
expect(push.path).to eql(expected)
end
end
Expand Down

0 comments on commit efad822

Please sign in to comment.