diff options
-rw-r--r-- | apps/patchwork/views/base.py | 2 | ||||
-rw-r--r-- | apps/settings.py | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/apps/patchwork/views/base.py b/apps/patchwork/views/base.py index 7707653..fa7dd99 100644 --- a/apps/patchwork/views/base.py +++ b/apps/patchwork/views/base.py @@ -43,7 +43,7 @@ def pwclientrc(request, project_id): project = get_object_or_404(Project, linkname = project_id) context = PatchworkRequestContext(request) context.project = project - if request.is_secure(): + if settings.FORCE_HTTPS_LINKS or request.is_secure(): context['scheme'] = 'https' else: context['scheme'] = 'http' diff --git a/apps/settings.py b/apps/settings.py index 537c380..43a37d8 100644 --- a/apps/settings.py +++ b/apps/settings.py @@ -114,6 +114,11 @@ ENABLE_XMLRPC = False # of patchwork COMPAT_REDIR = True +# Set to True to always generate https:// links instead of guessing +# the scheme based on current access. This is useful if SSL protocol +# is terminated upstream of the server (e.g. at the load balancer) +FORCE_HTTPS_LINKS = False + try: from local_settings import * except ImportError, ex: |