summaryrefslogtreecommitdiff
path: root/pgweb/util
diff options
context:
space:
mode:
authorMagnus Hagander2016-05-19 17:34:44 +0000
committerMagnus Hagander2016-05-24 19:13:00 +0000
commit753d20545a6d971500c6028332e69bc29e1771b2 (patch)
tree67a1af812c7a5b79214429b93c255d64e7bbb226 /pgweb/util
parent0a5213b2b66b94a35eafdb7789c29d2b949f5b71 (diff)
Remove SSL optional tag
Diffstat (limited to 'pgweb/util')
-rw-r--r--pgweb/util/decorators.py14
-rw-r--r--pgweb/util/middleware.py5
2 files changed, 0 insertions, 19 deletions
diff --git a/pgweb/util/decorators.py b/pgweb/util/decorators.py
index a76ecc98..abfbc70c 100644
--- a/pgweb/util/decorators.py
+++ b/pgweb/util/decorators.py
@@ -1,20 +1,6 @@
import datetime
from functools import wraps
-def ssl_required(fn):
- def _require_ssl(request, *_args, **_kwargs):
- return fn(request, *_args, **_kwargs)
- _require_ssl.ssl_required = True
- # wraps retains original function attributes such as __name__, csrf_exempt, etc
- return wraps(_require_ssl)(fn)
-
-def ssl_optional(fn):
- def _optional_ssl(request, *_args, **_kwargs):
- return fn(request, *_args, **_kwargs)
- _optional_ssl.ssl_optional = True
- # wraps retains original function attributes such as __name__, csrf_exempt, etc
- return wraps(_optional_ssl)(fn)
-
def nocache(fn):
def _nocache(request, *_args, **_kwargs):
resp = fn(request, *_args, **_kwargs)
diff --git a/pgweb/util/middleware.py b/pgweb/util/middleware.py
index 41af9157..f389862e 100644
--- a/pgweb/util/middleware.py
+++ b/pgweb/util/middleware.py
@@ -24,11 +24,6 @@ class PgMiddleware(object):
if hasattr(settings,'NO_HTTPS_REDIRECT') and settings.NO_HTTPS_REDIRECT:
return None
- # Does this view allow both SSL and non-ssl?
- if getattr(view_func, 'ssl_optional', False):
- # SSL is optional, so perform no redirects
- return None
-
# Always redirect the admin interface to https
if request.path.startswith('/admin'):
if not request.is_secure():