Skip to content

Commit cdb1372

Browse files
committed
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.
1 parent 8a5ce2b commit cdb1372

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

readthedocs/projects/views/public.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ def get_context_data(self, **kwargs):
9090
user=self.request.user, project=project)
9191

9292
protocol = 'http'
93-
if self.request.is_secure():
93+
use_https = getattr(settings, 'PUBLIC_DOMAIN_USES_HTTPS', False)
94+
if use_https:
9495
protocol = 'https'
9596

9697
version_slug = project.get_default_version()

0 commit comments

Comments
 (0)