File size: 235 Bytes
857a91b
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
package hf

import "net/http"

// applyAuth attaches a bearer token to the request when a token is configured.
func applyAuth(req *http.Request, token string) {
	if token != "" {
		req.Header.Set("Authorization", "Bearer "+token)
	}
}