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.
This commit is contained in:
parent
8a3a7f7c39
commit
5c9d3bf3cf
1 changed files with 2 additions and 1 deletions
|
@ -9,8 +9,9 @@ from flask import abort, Flask, render_template, request
|
||||||
from redis.exceptions import ConnectionError
|
from redis.exceptions import ConnectionError
|
||||||
from werkzeug.urls import url_quote_plus
|
from werkzeug.urls import url_quote_plus
|
||||||
from werkzeug.urls import url_unquote_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)
|
URL_PREFIX = os.environ.get('URL_PREFIX', None)
|
||||||
TOKEN_SEPARATOR = '~'
|
TOKEN_SEPARATOR = '~'
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue