mirror of
https://github.com/lordmathis/llamactl.git
synced 2025-11-05 16:44:22 +00:00
Add API key header for remote instances in proxy build
This commit is contained in:
@@ -122,6 +122,11 @@ func (p *proxy) build() (*httputil.ReverseProxy, error) {
|
||||
proxy.Director = func(req *http.Request) {
|
||||
originalDirector(req)
|
||||
|
||||
// Add API key header for remote instances
|
||||
if p.instance.IsRemote() && p.apiKey != "" {
|
||||
req.Header.Set("Authorization", "Bearer "+p.apiKey)
|
||||
}
|
||||
|
||||
// Update last request time
|
||||
p.updateLastRequestTime()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user