Parcourir la source

newClient must prepend scheme to default host

this updates newClient to prepend the scheme https to the default host
found in the global config, and only use said host when both the user
and host are configured
pull/36/head
Rob Loranger il y a 4 ans
Parent
révision
836eea7dab
Aucune clé connue n'a été trouvée dans la base pour cette signature ID de la clé GPG: D6F1633A4F0903B8
1 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. +2
    -2
      api/api.go

+ 2
- 2
api/api.go Voir le fichier

@@ -34,8 +34,8 @@ func newClient(c *cli.Context) (*writeas.Client, error) {
}
if host := HostURL(c); host != "" {
clientConfig.URL = host + "/api"
} else if cfg.Default.Host != "" {
clientConfig.URL = cfg.Default.Host + "/api"
} else if cfg.Default.Host != "" && cfg.Default.User != "" {
clientConfig.URL = "https://" + cfg.Default.Host + "/api"
} else if config.IsDev() {
clientConfig.URL = config.DevBaseURL + "/api"
} else if c.App.Name == "writeas" {


Chargement…
Annuler
Enregistrer