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:
@@ -175,7 +175,7 @@ func (c *Client) setCommonHeaders(req *http.Request) {
|
|||||||
// Azure API Key authentication
|
// Azure API Key authentication
|
||||||
if c.config.APIType == APITypeAzure {
|
if c.config.APIType == APITypeAzure {
|
||||||
req.Header.Set(AzureAPIKeyHeader, c.config.authToken)
|
req.Header.Set(AzureAPIKeyHeader, c.config.authToken)
|
||||||
} else {
|
} else if c.config.authToken != "" {
|
||||||
// OpenAI or Azure AD authentication
|
// OpenAI or Azure AD authentication
|
||||||
req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", c.config.authToken))
|
req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", c.config.authToken))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user