cmd: print proxy info when OLLAMA_DEBUG is true
This commit is contained in:
parent
e9aa5117c4
commit
07c45d6197
@ -106,6 +106,15 @@ func (c *Client) do(ctx context.Context, method, path string, reqData, respData
|
||||
request.Header.Set("Accept", "application/json")
|
||||
request.Header.Set("User-Agent", fmt.Sprintf("ollama/%s (%s %s) Go/%s", version.Version, runtime.GOARCH, runtime.GOOS, runtime.Version()))
|
||||
|
||||
if envconfig.Debug() {
|
||||
proxy, err := http.ProxyFromEnvironment(request)
|
||||
if err != nil {
|
||||
fmt.Println("proxy parse error: " + err.Error())
|
||||
} else {
|
||||
fmt.Println("proxy found: " + proxy.String())
|
||||
}
|
||||
}
|
||||
|
||||
respObj, err := c.http.Do(request)
|
||||
if err != nil {
|
||||
return err
|
||||
|
Loading…
x
Reference in New Issue
Block a user