Files
CLIProxyAPI/internal/util
muzhi1991 8f9e6622b0 fix(util): forward custom Host header to upstream
Custom headers configured under openai-compatibility (and any other
provider passing through applyCustomHeaders) were silently dropped for
the Host key, because Go's net/http reads the wire Host from
req.Host, not req.Header["Host"]. As a result, virtual-host routed
upstreams (e.g. LiteLLM behind an ingress) saw the base-url's host
instead of the user-configured override and returned 404.

Detect the Host key with http.CanonicalHeaderKey and assign it to
req.Host so it is actually written on the wire. Other headers continue
to use Header.Set as before.

Fixes #2833
2026-04-16 20:45:37 +08:00
..
2026-03-11 11:08:02 +08:00