Ticket #5342: 0001-Use-urljoin-to-create-proper-feed-media-URLs.patch

File 0001-Use-urljoin-to-create-proper-feed-media-URLs.patch, 1.3 KB (added by ayleph, 9 years ago)
  • mediagoblin/db/models.py

    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  
    4545from mediagoblin.tools.routing import extract_url_arguments
    4646
    4747import six
     48from six.moves.urllib.parse import urljoin
    4849from pytz import UTC
    4950
    5051_log = logging.getLogger(__name__)
    class MediaEntry(Base, MediaEntryMixin, CommentingMixin):  
    742743            "objectType": self.object_type,
    743744            "url": self.url_for_self(request.urlgen, qualified=True),
    744745            "image": {
    745                 "url": request.host_url + self.thumb_url[1:],
     746                "url": urljoin(request.host_url, self.thumb_url),
    746747            },
    747748            "fullImage":{
    748                 "url": request.host_url + self.original_url[1:],
     749                "url": urljoin(request.host_url, self.original_url),
    749750            },
    750751            "published": published.isoformat(),
    751752            "updated": updated.isoformat(),