Skip to content
This repository has been archived by the owner on Sep 28, 2024. It is now read-only.

Commit

Permalink
add X-Llm_proxy-version header to response
Browse files Browse the repository at this point in the history
  • Loading branch information
robbyt committed Sep 3, 2024
1 parent 6670120 commit f4274e3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion proxy/addons/addIDToHeaders.go
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -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())
}

0 comments on commit f4274e3

Please sign in to comment.