Skip to content

Commit

Permalink
disabled hsts header in flask-talisman
Browse files Browse the repository at this point in the history
Currently we set two HSTS headers. One in `flask-talisman` and one in
our nginx configuration. This is bad, mhhhhkaaaaay. So let's disable our
hsts header in `flask-talisman` and let's nginx do its job.

Signed-off-by: Christian Rebischke <chris@nullday.de>
  • Loading branch information
Christian Rebischke authored and jelly committed Feb 27, 2019
1 parent 17530ac commit 5c8fdd9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions config.py
Expand Up @@ -55,6 +55,7 @@ def set_debug_flag(debug):
FLASK_PORT = config_flask.getint('port')
FLASK_SESSION_PROTECTION = None if 'none' == config_flask['session_protection'] else config_flask['session_protection']
set_debug_flag(config_flask.getboolean('debug'))
FLASK_STRICT_TRANSPORT_SECURITY = config_flask.getboolean('strict_transport_security')

config_pacman = config['pacman']
PACMAN_HANDLE_CACHE_TIME = config_pacman.getint('handle_cache_time')
1 change: 1 addition & 0 deletions config/00-default.conf
Expand Up @@ -18,6 +18,7 @@ debug = off
secret_key = changeme_iddqd
csrf = on
session_protection = strong
strict_transport_security = off

[sqlalchemy]
echo = no
Expand Down
3 changes: 2 additions & 1 deletion tracker/__init__.py
Expand Up @@ -12,6 +12,7 @@
from werkzeug.routing import BaseConverter

from config import FLASK_SESSION_PROTECTION
from config import FLASK_STRICT_TRANSPORT_SECURITY
from config import SQLALCHEMY_MIGRATE_REPO
from config import SQLITE_CACHE_SIZE
from config import SQLITE_JOURNAL_MODE
Expand Down Expand Up @@ -75,7 +76,7 @@ def db_get_or_create(self, model, defaults=None, **kwargs):
db.get_or_create = MethodType(db_get_or_create, db)

migrate = Migrate(db=db, directory=SQLALCHEMY_MIGRATE_REPO)
talisman = Talisman()
talisman = Talisman(strict_transport_security=FLASK_STRICT_TRANSPORT_SECURITY)
login_manager = LoginManager()
tracker = Blueprint('tracker', __name__)

Expand Down

0 comments on commit 5c8fdd9

Please sign in to comment.