Open SystemFuchs opened 4 months ago
Hi @SystemFuchs, the Invalid header value
can show up if you are providing a header-value that contains non-ASCII characters.
Using the provided example, if you pass a new line character in one of your inputs you will get the same error. Could you please check if all your header-values are valid ?
Unfortunately, I didn't found an issue about secret. Also, unpopulated secret would lead to an empty header which is valid.
There is no new line char in the token. I've changed the token & here is the one which didn't work:
Plain: tk_ooiassuvoqrrrlohi0vqm7fiachhg base64: dGtfb29pYXNzdXZvcXJycmxvaGkwdnFtN2ZpYWNoaGcK
Same here
I solved it with
headers: Authorization: "Bearer {{ secret('HASS_API_TOKEN').strip() }}"
Strips the leading newline
Describe the issue
Defined a token for a HTTP API request & wanted to use that token as a secret. I'm only getting an error message "Invalid header". Token is usable for the script as the print_token task shows the correct Bearer token. You will get the "Invalid header" error regardless which kind of header you try to populate with the secret.
Environment