From b36e764507c0cbf6c2b12be30bfbcf2128216e0a Mon Sep 17 00:00:00 2001 From: Noah Petherbridge Date: Thu, 31 Dec 2015 04:18:28 +0000 Subject: [PATCH] Fix SSLify test --- defaults.yml | 2 +- rophako/app.py | 2 +- rophako/model/wiki.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/defaults.yml b/defaults.yml index 4fd0d5c..ca04e82 100644 --- a/defaults.yml +++ b/defaults.yml @@ -59,7 +59,7 @@ rophako: # will do the following: # - Send HTTP Strict-Transport-Security header # - Use secure session cookies (SSL-only) - force_ssl: true + force_ssl: false # Secret key used for session cookie signing. Make this long and hard to # guess. diff --git a/rophako/app.py b/rophako/app.py index 71bf418..adcf9e2 100644 --- a/rophako/app.py +++ b/rophako/app.py @@ -44,7 +44,7 @@ app.secret_key = bytes(Config.security.secret_key.encode("utf-8")) \ .decode(string_escape) # Security? -if Config.security.force_ssl == "true": +if Config.security.force_ssl == True: app.config['SESSION_COOKIE_SECURE'] = True sslify = SSLify(app) diff --git a/rophako/model/wiki.py b/rophako/model/wiki.py index 993e1a1..03fb4ea 100644 --- a/rophako/model/wiki.py +++ b/rophako/model/wiki.py @@ -74,7 +74,7 @@ def edit_page(name, author, body, note, history=True): # The new revision to be added. rev = dict( - id=hashlib.md5(str(int(time.time()))).hexdigest(), + id=hashlib.md5(str(int(time.time())).encode("utf-8")).hexdigest(), time=int(time.time()), author=author, body=body,