浏览代码

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 4 年前
父节点
当前提交
836eea7dab
找不到此签名对应的密钥 GPG 密钥 ID: D6F1633A4F0903B8
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. +2
    -2
      api/api.go

+ 2
- 2
api/api.go 查看文件

@@ -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" {


正在加载...
取消
保存