From 7745e19ff7872bcc549eb5e6955dae408fd21acf Mon Sep 17 00:00:00 2001 From: Marian Steinbach Date: Tue, 16 Nov 2021 14:50:42 +0100 Subject: [PATCH] Only set Authorization header when AccessToken is set --- streaming.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/streaming.go b/streaming.go index f560fd8..2148ed0 100644 --- a/streaming.go +++ b/streaming.go @@ -92,7 +92,10 @@ func (c *Client) streaming(ctx context.Context, p string, params url.Values) (ch return nil, err } req = req.WithContext(ctx) - req.Header.Set("Authorization", "Bearer "+c.Config.AccessToken) + + if c.Config.AccessToken != "" { + req.Header.Set("Authorization", "Bearer "+c.Config.AccessToken) + } q := make(chan Event) go func() {