Refactor RemoteOpenAIProxy to use cached proxies and restore request body handling

This commit is contained in:
2025-10-07 18:57:08 +02:00
parent aae3f84d49
commit 6298b03636
2 changed files with 54 additions and 55 deletions

View File

@@ -407,9 +407,9 @@ func (h *Handler) RemoteInstanceProxy(w http.ResponseWriter, r *http.Request, na
nodeName := options.Nodes[0]
// Check if we have a cached proxy for this instance
// Check if we have a cached proxy for this node
h.remoteProxiesMu.RLock()
proxy, exists := h.remoteProxies[name]
proxy, exists := h.remoteProxies[nodeName]
h.remoteProxiesMu.RUnlock()
if !exists {
@@ -447,9 +447,9 @@ func (h *Handler) RemoteInstanceProxy(w http.ResponseWriter, r *http.Request, na
}
}
// Cache the proxy
// Cache the proxy by node name
h.remoteProxiesMu.Lock()
h.remoteProxies[name] = proxy
h.remoteProxies[nodeName] = proxy
h.remoteProxiesMu.Unlock()
}