Update client.go - allow to skip Authorization header (#658)

* Update client.go - allow to skip Authorization header

* Update client.go
This commit is contained in:
Igor Berlenko
2024-02-16 18:22:38 +08:00
committed by GitHub
parent ff61bbb322
commit 69e3bbb1eb

View File

@@ -175,7 +175,7 @@ func (c *Client) setCommonHeaders(req *http.Request) {
// Azure API Key authentication
if c.config.APIType == APITypeAzure {
req.Header.Set(AzureAPIKeyHeader, c.config.authToken)
} else {
} else if c.config.authToken != "" {
// OpenAI or Azure AD authentication
req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", c.config.authToken))
}