diff --git a/readme.md b/readme.md index 1aff1afb9ad0c3dabd9460e2cb0f65fb69523a7d..b92ed986fbd78ccf8479432a50c835915b5826a1 100644 --- a/readme.md +++ b/readme.md @@ -1,7 +1,10 @@ # 发布 -## go vendor - +```bash +go mod init +go mod vendor +go mod tidy +``` # 单条服务 PROXY_HOST=apaas.wodcloud.com diff --git a/src/handler/proxyhandler.go b/src/handler/proxyhandler.go index 04f0285146e8d3c1d244e7256d9888dac43a2ab4..896dd430fe33440092ce3479bb89ed99c0db6802 100644 --- a/src/handler/proxyhandler.go +++ b/src/handler/proxyhandler.go @@ -42,9 +42,9 @@ func getProxyURL(req *http.Request) string { result = fmt.Sprintf("http://%s%s", config.ProxyHost, path) } else { result = fmt.Sprintf("http://%s%s?%s", config.ProxyHost, path, rawQuery) - } - if strings.HasSuffix(result, "/") { - result = strings.TrimRight(result, "/") + if strings.HasSuffix(result, "/") { + result = strings.TrimRight(result, "/") + } } return result }