only modify certain requests

This commit is contained in:
2025-04-23 15:23:13 +03:00
parent 249619abc5
commit 5352dc7200

View File

@@ -70,7 +70,9 @@ func createProxy(target *url.URL) func(http.ResponseWriter, *http.Request) {
proxy := httputil.NewSingleHostReverseProxy(target) proxy := httputil.NewSingleHostReverseProxy(target)
proxy.Director = director proxy.Director = director
if r.URL.Path == "/api/generate" {
proxy.ModifyResponse = modifyResponse proxy.ModifyResponse = modifyResponse
}
proxy.ServeHTTP(w, r) proxy.ServeHTTP(w, r)
} }