Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Env Provider: String is converted to number when it shouldn't be #17

Closed
dbofmmbt opened this issue Jun 14, 2021 · 1 comment
Closed

Comments

@dbofmmbt
Copy link

dbofmmbt commented Jun 14, 2021

Hello, I noticed that environment variables like these are converted to an integer:

SECURE_PASSWORD="123456"

As I'm expecting for a string, I get an error in the config parsing.

I thought that putting " around the number would be enough to make it be considered as a string.

# Parsed as number. Shouldn't it be considered as string?
SECURE_PASSWORD="123456"

# This one is considered as a number, which makes sense
SECURE_NUMBER=123456
@SergioBenitez
Copy link
Owner

That's a string to your shell, which is passed as 123456 in the environment variable value. Try echo "foo" vs. echo foo. You need to escape the quotes. This depends on your shell. SECURE_PASSWORD="\"123456\"" should work. SECURE_PASSWORD=\"123456\" might work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants