From 753d20545a6d971500c6028332e69bc29e1771b2 Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Thu, 19 May 2016 13:34:44 -0400 Subject: Remove SSL optional tag --- pgweb/util/decorators.py | 14 -------------- pgweb/util/middleware.py | 5 ----- 2 files changed, 19 deletions(-) (limited to 'pgweb/util') 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(): -- cgit v1.2.3