8000 Just check for a url scheme to allow users to provide a handler. · pythonAI/client_python@e3071c4 · GitHub
[go: up one dir, main page]

Skip to content

Commit e3071c4

Browse files
tim-seossrossigee
authored andcommitted
Just check for a url scheme to allow users to provide a handler.
1 parent 67fe14a commit e3071c4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

prometheus_client/exposition.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,8 @@ def delete_from_gateway(gateway, job, grouping_key=None, timeout=None):
172172

173173

174174
def _use_gateway(method, gateway, job, registry, grouping_key, timeout):
175-
if not (gateway.startswith('http://') or gateway.startswith('https://')):
175+
gateway_url = urlparse(gateway)
176+
if not gateway_url.scheme:
176177
gateway = 'http://{0}'.format(gateway)
177178
url = '{0}/metrics/job/{1}'.format(gateway, quote_plus(job))
178179

0 commit comments

Comments
 (0)
0