Skip to content

Commit 5c9d3bf

Browse files
authored
properly parse NO_SSL env var (#126)
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.
1 parent 8a3a7f7 commit 5c9d3bf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

snappass/main.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
from redis.exceptions import ConnectionError
1010
from werkzeug.urls import url_quote_plus
1111
from werkzeug.urls import url_unquote_plus
12+
from distutils.util import strtobool
1213

13-
NO_SSL = os.environ.get('NO_SSL', False)
14+
NO_SSL = bool(strtobool(os.environ.get('NO_SSL', 'False')))
1415
URL_PREFIX = os.environ.get('URL_PREFIX', None)
1516
TOKEN_SEPARATOR = '~'
1617

0 commit comments

Comments
 (0)