Skip to content

Commit

Permalink
properly parse NO_SSL env var (#126)
Browse files Browse the repository at this point in the history
Bug fix:
The default for `NO_SSL` environment variable is `False`.
When the actual value, in runtime, is `True`, the code "ignores" it.
The reason: the code does not parse the given string. So it evaluates a non empty string as "True".
To resolve this, the suggested code parses the given string to a boolean value.
  • Loading branch information
kleinron authored Sep 14, 2020
1 parent 8a3a7f7 commit 5c9d3bf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion snappass/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
from redis.exceptions import ConnectionError
from werkzeug.urls import url_quote_plus
from werkzeug.urls import url_unquote_plus
from distutils.util import strtobool

NO_SSL = os.environ.get('NO_SSL', False)
NO_SSL = bool(strtobool(os.environ.get('NO_SSL', 'False')))
URL_PREFIX = os.environ.get('URL_PREFIX', None)
TOKEN_SEPARATOR = '~'

Expand Down

0 comments on commit 5c9d3bf

Please sign in to comment.