mirror of
https://github.com/ollama/ollama.git
synced 2026-04-21 16:25:42 +02:00
cloud_proxy: send ollama client version (#14769)
This was previously included in the user agent, and we've made use of it in the past to hotpatch bugs server-side for particular Ollama versions.
This commit is contained in:
@@ -12,6 +12,7 @@ import (
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
internalcloud "github.com/ollama/ollama/internal/cloud"
|
||||
"github.com/ollama/ollama/version"
|
||||
)
|
||||
|
||||
type webExperimentalUpstreamCapture struct {
|
||||
@@ -92,6 +93,7 @@ func TestExperimentalWebEndpointsPassthrough(t *testing.T) {
|
||||
req.Header.Set("Content-Type", "application/json")
|
||||
req.Header.Set("Authorization", "Bearer should-forward")
|
||||
req.Header.Set("X-Test-Header", "web-experimental")
|
||||
req.Header.Set(cloudProxyClientVersionHeader, "should-be-overwritten")
|
||||
|
||||
resp, err := local.Client().Do(req)
|
||||
if err != nil {
|
||||
@@ -115,6 +117,9 @@ func TestExperimentalWebEndpointsPassthrough(t *testing.T) {
|
||||
if got := capture.header.Get("X-Test-Header"); got != "web-experimental" {
|
||||
t.Fatalf("expected forwarded X-Test-Header=web-experimental, got %q", got)
|
||||
}
|
||||
if got := capture.header.Get(cloudProxyClientVersionHeader); got != version.Version {
|
||||
t.Fatalf("expected %s=%q, got %q", cloudProxyClientVersionHeader, version.Version, got)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user