fix proxy to https issue

This commit is contained in:
2023-09-27 14:05:25 +08:00
parent 43d3ef275e
commit 4a714dcd0e

View File

@@ -557,11 +557,7 @@ func (c *HandleController) MakeProxyFunc() func(context *gin.Context) {
host := c.CommonInfo.DashboardAddr
port := c.CommonInfo.DashboardPort
if strings.HasPrefix(host, "http://") {
host, _ = strings.CutPrefix(host, "http://")
} else if strings.HasPrefix(host, "https://") {
host, _ = strings.CutPrefix(host, "https://")
}
host, _ = strings.CutPrefix(host, protocol)
requestUrl := protocol + host + ":" + strconv.Itoa(port) + context.Param("serverApi")
request, _ := http.NewRequest("GET", requestUrl, nil)