You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using an API key with a newline at the end will make SendGrid respond with the error "Content-Type should be application/json".
Since this repo is for the PHP SDK specifically, it might not be the best place for it, but since I've used this package I thought I post the issue here.
This is strictly speaking a user-error, but I think SendGrid should give a better error, saying that the it is the API key that's wrong.
Maybe it could just trim whitespaces?
I'm no security expert, so not sure about that.
For more background, this happened to me because I was saving the key as base64 encoded string in an env var for later use (using k8s secrets), and the command I used was:
echo 'myapikey' | base64
☝️ What I missed here is that "echo" will add a newline at the end by default, so the correct way to do this is:
Using an API key with a newline at the end will make SendGrid respond with the error "Content-Type should be application/json".
Since this repo is for the PHP SDK specifically, it might not be the best place for it, but since I've used this package I thought I post the issue here.
This is strictly speaking a user-error, but I think SendGrid should give a better error, saying that the it is the API key that's wrong.
Maybe it could just trim whitespaces?
I'm no security expert, so not sure about that.
For more background, this happened to me because I was saving the key as base64 encoded string in an env var for later use (using k8s secrets), and the command I used was:
☝️ What I missed here is that "echo" will add a newline at the end by default, so the correct way to do this is:
Even if this is not fixed I hope that I help someone in the future googling, because it took me a while to finally find this by accident:
http://jlsegurosystem.com.br/vendor/sendgrid/sendgrid/TROUBLESHOOTING.md
The text was updated successfully, but these errors were encountered: