Only set Authorization header when AccessToken is set
This commit is contained in:
		
							parent
							
								
									45d75e8085
								
							
						
					
					
						commit
						7745e19ff7
					
				
					 1 changed files with 4 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -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() {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue