Closed marinac-dev closed 1 year ago
We do not accept nil
in the headers as seen in the typespec: https://hexdocs.pm/mint/Mint.Types.html#t:headers/0. Handling nil
would mean we have to make the decision if the header should be removed or the value should be ""
. This decision will be different for different applications so mint cannot make it.
If you are using System.get_env
it takes a second argument where you can give a default value that isn't nil
.
If the value of header is
nil
it will just throw error.I think I could make a bug reproducing repo in free time, but what caused this in my case is a dependency. In dependency, there is macro
@api_key Application.compile_env(:my_app, :api_key)
(yes I know I shouldn't use that, I will change it) which requires setting it in somewhere inconfig.exs
but if I don't do that header value becomes nil and bum bug. :)In my config, I use System.get_env to fetch header value I am using Tesla with Finch adapter