fix(inputs.http): Use correct token variable (#14350)

fixes: #14347
This commit is contained in:
Joshua Powers 2023-11-27 10:09:26 -07:00 committed by GitHub
parent 65d106f615
commit 7b5393c9e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -128,7 +128,7 @@ func (h *HTTP) gatherURL(acc telegraf.Accumulator, url string) error {
token.Destroy() token.Destroy()
request.Header.Set("Authorization", bearer) request.Header.Set("Authorization", bearer)
} else if h.TokenFile != "" { } else if h.TokenFile != "" {
token, err := os.ReadFile(h.BearerToken) token, err := os.ReadFile(h.TokenFile)
if err != nil { if err != nil {
return err return err
} }