Skip to content

Commit 1c796bf

Browse files
author
Mathieu Grzybek
committed
[api] use anonymous call if the token is empty
1 parent 4ca8064 commit 1c796bf

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

utils/api.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ import (
99

1010
func CallAPIGet(url, token string) ([]byte, error) {
1111
req, _ := http.NewRequest("GET", url, nil)
12-
req.Header.Add("Authorization", "Bearer "+token)
12+
if token != "" {
13+
req.Header.Add("Authorization", "Bearer "+token)
14+
}
1315
req.Header.Set("Content-Type", "application/json")
1416

1517
client := &http.Client{}

0 commit comments

Comments
 (0)