Skip to content

Commit

Permalink
Merge pull request #4228 from italia/httpsbadgeupstream
Browse files Browse the repository at this point in the history
projects: serve badge with same protocol as site
  • Loading branch information
ericholscher authored Jun 18, 2018
2 parents f5e8705 + 8e85110 commit 08beab1
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions readthedocs/projects/views/public.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,9 @@ 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%s?version=%s' % (
protocol,
context['badge_url'] = '//%s%s?version=%s' % (
settings.PRODUCTION_DOMAIN,
reverse('project_badge', args=[project.slug]),
project.get_default_version(),
Expand Down

0 comments on commit 08beab1

Please sign in to comment.