Skip to content

Commit

Permalink
Allow using sslify even in DEBUG mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
cancan101 committed Nov 19, 2014
1 parent 648d7c9 commit 2cee4fb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sslify/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ class SSLifyMiddleware(object):
"""
def process_request(self, request):
# If the user has explicitly disabled SSLify, do nothing.
if getattr(settings, 'SSLIFY_DISABLE', False):
if getattr(settings, 'SSLIFY_DISABLE', settings.DEBUG):
return None

# If we get here, proceed as normal.
if not any((settings.DEBUG, request.is_secure())):
if not request.is_secure():
url = request.build_absolute_uri(request.get_full_path())
secure_url = url.replace('http://', 'https://')
return HttpResponsePermanentRedirect(secure_url)

0 comments on commit 2cee4fb

Please sign in to comment.