From cdb1372403944435bad3e11e40e046f2b26bb8ad Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Tue, 12 Jun 2018 14:59:15 +0200 Subject: [PATCH] projects: serve badge with same protocol as resolver Instead of request.is_secure use settings.PUBLIC_DOMAIN_USES_HTTPS to find out if we should serve the badge under https or not. That matches what the resolver is doing and works here. --- readthedocs/projects/views/public.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/readthedocs/projects/views/public.py b/readthedocs/projects/views/public.py index 14d763e1fab..fb8872111cb 100644 --- a/readthedocs/projects/views/public.py +++ b/readthedocs/projects/views/public.py @@ -90,7 +90,8 @@ def get_context_data(self, **kwargs): user=self.request.user, project=project) protocol = 'http' - if self.request.is_secure(): + use_https = getattr(settings, 'PUBLIC_DOMAIN_USES_HTTPS', False) + if use_https: protocol = 'https' version_slug = project.get_default_version()