From edce539b62fe80edee1b4b3260fab9d8efe657a4 Mon Sep 17 00:00:00 2001
From: ayleph <ayleph@thisshitistemp.com>
Date: Tue, 3 Nov 2015 22:56:33 -0500
Subject: [PATCH] Use urljoin to create proper feed media URLs
---
mediagoblin/db/models.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/mediagoblin/db/models.py b/mediagoblin/db/models.py
index 6765955..430d081 100644
a
|
b
|
from mediagoblin.tools.common import import_component
|
45 | 45 | from mediagoblin.tools.routing import extract_url_arguments |
46 | 46 | |
47 | 47 | import six |
| 48 | from six.moves.urllib.parse import urljoin |
48 | 49 | from pytz import UTC |
49 | 50 | |
50 | 51 | _log = logging.getLogger(__name__) |
… |
… |
class MediaEntry(Base, MediaEntryMixin, CommentingMixin):
|
742 | 743 | "objectType": self.object_type, |
743 | 744 | "url": self.url_for_self(request.urlgen, qualified=True), |
744 | 745 | "image": { |
745 | | "url": request.host_url + self.thumb_url[1:], |
| 746 | "url": urljoin(request.host_url, self.thumb_url), |
746 | 747 | }, |
747 | 748 | "fullImage":{ |
748 | | "url": request.host_url + self.original_url[1:], |
| 749 | "url": urljoin(request.host_url, self.original_url), |
749 | 750 | }, |
750 | 751 | "published": published.isoformat(), |
751 | 752 | "updated": updated.isoformat(), |