Browse Source

Use url.UserPassword() so passwords are escaped (#101)

* add Dockerfile

* dockerfile: switch to multi-stage build to lighten up the final image

* dockerfile: update to latest images, and update the 2nd stage image on build

* Use url.UserPassword() so passwords are escaped
master
Andy Cobaugh 2 years ago
committed by GitHub
parent
commit
dac91ccd2d
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      vsphere-influxdb.go

3
vsphere-influxdb.go

@ -110,7 +110,8 @@ func (vcenter *VCenter) Connect() error {
defer cancel()
stdlog.Println("Connecting to vcenter:", vcenter.Hostname)
u, err := url.Parse("https://" + vcenter.Username + ":" + vcenter.Password + "@" + vcenter.Hostname + "/sdk")
u, err := url.Parse("https://" + vcenter.Hostname + "/sdk")
u.User = url.UserPassword(vcenter.Username, vcenter.Password)
if err != nil {
errlog.Println("Could not parse vcenter url:", vcenter.Hostname)
errlog.Println("Error:", err)

Loading…
Cancel
Save