From f4274e3bc81e0eeb2da22018f9feb7a9e7b5e56d Mon Sep 17 00:00:00 2001 From: Robert Terhaar Date: Tue, 3 Sep 2024 01:07:49 -0400 Subject: [PATCH] add X-Llm_proxy-version header to response --- proxy/addons/addIDToHeaders.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/proxy/addons/addIDToHeaders.go b/proxy/addons/addIDToHeaders.go index f42c560..948330d 100644 --- a/proxy/addons/addIDToHeaders.go +++ b/proxy/addons/addIDToHeaders.go @@ -1,11 +1,13 @@ package addons import ( + "github.com/proxati/llm_proxy/v2/version" px "github.com/proxati/mitmproxy/proxy" ) const ( - idHeader = "X-Llm_proxy-id" + idHeader = "X-Llm_proxy-id" + idVersion = "X-Llm_proxy-version" ) type AddIDToHeaders struct { @@ -18,4 +20,5 @@ func NewAddIDToHeaders() *AddIDToHeaders { func (c *AddIDToHeaders) Response(f *px.Flow) { f.Response.Header.Add(idHeader, f.Id.String()) + f.Response.Header.Add(idVersion, version.String()) }