refactor, fix reload error when using agents, and other small improvements

This commit is contained in:
yusing
2025-02-11 12:15:51 +08:00
parent b1f72620dc
commit 429a77de8e
10 changed files with 139 additions and 105 deletions

View File

@@ -49,7 +49,7 @@ func ProxyHTTP(w http.ResponseWriter, r *http.Request) {
r.URL.Scheme = ""
r.URL.Host = ""
r.URL.Path = r.URL.Path[agent.HTTPProxyURLStripLen:] // strip the {API_BASE}/proxy/http prefix
r.URL.Path = r.URL.Path[agent.HTTPProxyURLPrefixLen:] // strip the {API_BASE}/proxy/http prefix
r.RequestURI = r.URL.String()
r.URL.Host = host
r.URL.Scheme = scheme