From 858930be9b904b571cf535c5d8bc6cd9c8de779f Mon Sep 17 00:00:00 2001 From: Igor Berlenko Date: Fri, 16 Feb 2024 18:22:38 +0800 Subject: [PATCH] Update client.go - allow to skip Authorization header (#658) * Update client.go - allow to skip Authorization header * Update client.go --- client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client.go b/client.go index 55c48bd4..7fdc36ca 100644 --- a/client.go +++ b/client.go @@ -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)) }