Skip to content

Commit

Permalink
Merge pull request #4353 from rtfd/revert-4228-httpsbadgeupstream
Browse files Browse the repository at this point in the history
Revert "projects: serve badge with same protocol as site"
  • Loading branch information
ericholscher committed Jul 11, 2018
2 parents ca7afe6 + 324aa34 commit faba0be
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion readthedocs/projects/views/public.py
Expand Up @@ -89,9 +89,14 @@ def get_context_data(self, **kwargs):
context['versions'] = Version.objects.public(
user=self.request.user, project=project)

protocol = 'http'
if self.request.is_secure():
protocol = 'https'

version_slug = project.get_default_version()

context['badge_url'] = '//%s%s?version=%s' % (
context['badge_url'] = '%s://%s%s?version=%s' % (
protocol,
settings.PRODUCTION_DOMAIN,
reverse('project_badge', args=[project.slug]),
project.get_default_version(),
Expand Down

0 comments on commit faba0be

Please sign in to comment.