Skip to content

Commit

Permalink
fix: missing auth (#396)
Browse files Browse the repository at this point in the history
  • Loading branch information
acha-bill authored Apr 26, 2024
1 parent 2dfd5b6 commit 6781b34
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/bee/debugapi/debugapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,14 @@ func (c *Client) requestWithHeader(ctx context.Context, method, path string, hea
req.Header = header
req.Header.Add("Accept", contentType)

if c.restricted && req.Header.Get("Authorization") == "" {
key, err := api.GetToken(path, method)
if err != nil {
return err
}
req.Header.Set("Authorization", "Bearer "+key)
}

r, err := c.httpClient.Do(req)
if err != nil {
return err
Expand Down

0 comments on commit 6781b34

Please sign in to comment.