Skip to content

Commit

Permalink
Merge f31bdcb into c80c550
Browse files Browse the repository at this point in the history
  • Loading branch information
dmagliola committed May 21, 2020
2 parents c80c550 + f31bdcb commit 37c03c4
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
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
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 37c03c4

Please sign in to comment.