Open kraemahz opened 4 months ago
I figured out my issue, it was related to the configuration of my prod environment. A new line character was sneaking in to the environment variable holding my API key and that's what caused the panic.
I think this is still worth fixing with some checks or coercion, but feel free to close if you don't agree after you see this.
I think a trim and a warning is probably reasonable. Will open a PR against the next
branch
Describe the bug
I have code that works in stripe test mode but causes a panic when switching to live mode. This is a basic implementation of a checkout session largely transcribed from stripe's other examples for embedded checkout code.
Update: I discovered the problem to be a newline character getting into my API key from the environment due to the way my production server loads its secrets.
I looked into http_types and it seems to be blindly doing an
unwrap
in this function, likely invoked by aninto
withinsend_inner
To Reproduce
Expected behavior
Should not panic
Code snippets
OS
linux
Rust version
1.79
Library version
0.37.1
API version
2024-04-10
Additional context
This is happening before I get a tick in the 'api calls' section of Stripe.