Commit c0407354 authored by fred's avatar fred
Browse files

podcasts: publish sound URLs as https on secure requests

parent 82d4d13f
......@@ -750,6 +750,10 @@ class PodcastsFeed(Feed):
description_template = 'feed/soundfile.html'
feed_type = RssCustomPodcastsFeed
def get_feed(self, obj, request):
self.request = request
return super().get_feed(obj, request)
def items(self):
return SoundFile.objects.select_related().filter(
podcastable=True).order_by('-creation_timestamp')[:50]
......@@ -766,7 +770,7 @@ class PodcastsFeed(Feed):
def item_enclosure_url(self, item):
current_site = Site.objects.get(id=settings.SITE_ID)
return add_domain(current_site.domain, item.get_format_url('mp3'))
return add_domain(current_site.domain, item.get_format_url('mp3'), self.request.is_secure())
def item_enclosure_length(self, item):
sound_path = item.get_format_path('mp3')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment