brandonweeks / vsphere_exporter

A Prometheus exporter for vSphere
Apache License 2.0
26 stars 15 forks source link

Vcenter URL contruction failed when using a password that has a trailing question mark #14

Open lubyou opened 7 years ago

lubyou commented 7 years ago

Hi,

I tried to connect to a vcenter server with an account whose password has a trailing question mark. The connection to the vcenter server failed with "invalid URL port".

Changing the password to something that does not contain a trailing question mark allows the exporter to connect.

This probably a bug in url.Parse and can potentially be worked around by constructing a UserInfo object (https://golang.org/pkg/net/url/#UserPassword), instead of relying on url.Parse to parse the credentials out of the URL.

Thank you