Просмотр исходного кода

do not parse url from configured host

now that the scheme is not required in the configuration file, we can
assume the configured value is correct. as with other uses, the
configured value is only used when noth host and user are present.
pull/36/head
Rob Loranger 4 лет назад
Родитель
Сommit
8625e42ce7
Не найден GPG ключ соответствующий данной подписи Идентификатор GPG ключа: D6F1633A4F0903B8
1 измененных файлов: 4 добавлений и 5 удалений
  1. +4
    -5
      config/options.go

+ 4
- 5
config/options.go Просмотреть файл

@@ -1,7 +1,6 @@
package config package config


import ( import (
"net/url"
"strings" "strings"


"github.com/cloudfoundry/jibber_jabber" "github.com/cloudfoundry/jibber_jabber"
@@ -99,9 +98,9 @@ func HostDirectory(c *cli.Context) (string, error) {
return hostFlag, nil return hostFlag, nil
} }


u, err := url.Parse(cfg.Default.Host)
if err != nil {
return "", err
if cfg.Default.Host != "" && cfg.Default.User != "" {
return cfg.Default.Host, nil
} }
return u.Hostname(), nil

return "", nil
} }

Загрузка…
Отмена
Сохранить