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

Skip to content

Commit 6e1e16a

Browse files
committed
Just check for a url scheme to allow users to provide a handler.
1 parent 1020618 commit 6e1e16a

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
@@ -165,7 +165,8 @@ def delete_from_gateway(gateway, job, grouping_key=None, timeout=None):
165165

166166

167167
def _use_gateway(method, gateway, job, registry, grouping_key, timeout):
168-
if not (gateway.startswith('http://') or gateway.startswith('https://')):
168+
gateway_url = urlparse(gateway)
169+
if not gateway_url.scheme:
169170
gateway = 'http://{0}'.format(gateway)
170171
url = '{0}/metrics/job/{1}'.format(gateway, quote_plus(job))
171172

0 commit comments

Comments
 (0)
0