From fb071a38fed27e3bf2406bba77ef8a2679a82963 Mon Sep 17 00:00:00 2001 From: ayleph 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 67659552..430d081d 100644 --- a/mediagoblin/db/models.py +++ b/mediagoblin/db/models.py @@ -45,6 +45,7 @@ from mediagoblin.tools.common import import_component from mediagoblin.tools.routing import extract_url_arguments import six +from six.moves.urllib.parse import urljoin from pytz import UTC _log = logging.getLogger(__name__) @@ -742,10 +743,10 @@ class MediaEntry(Base, MediaEntryMixin, CommentingMixin): "objectType": self.object_type, "url": self.url_for_self(request.urlgen, qualified=True), "image": { - "url": request.host_url + self.thumb_url[1:], + "url": urljoin(request.host_url, self.thumb_url), }, "fullImage":{ - "url": request.host_url + self.original_url[1:], + "url": urljoin(request.host_url, self.original_url), }, "published": published.isoformat(), "updated": updated.isoformat(), -- 2.25.1