Skip to content

Commit

Permalink
Merge pull request #39 from tomkoker/master
Browse files Browse the repository at this point in the history
Replace all illegal characters in environment variable
  • Loading branch information
chriddyp authored Jun 27, 2017
2 parents a2c0e8c + 5bf683c commit 8cc1ed9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions dash/dash.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from flask_compress import Compress
from flask_seasurf import SeaSurf
import os
import re
import importlib
import requests
import pkgutil
Expand Down Expand Up @@ -46,8 +47,8 @@ def __init__(
# If user supplied their own server, they might've supplied a
# secret_key with it
secret_key_name = 'dash_{}_secret_key'.format(
# TODO - check for other illegal characters
name.replace('.', '_')
# replace any invalid characters
re.sub('[\W_]+', '_', name)
)
secret_key = os.environ.get(
secret_key_name, SeaSurf()._generate_token()
Expand Down

0 comments on commit 8cc1ed9

Please sign in to comment.