Opened 5 years ago

Closed 5 years ago

#16753 closed Bug (fixed)

Handle protocol-relative URLs in syndication

Reported by: cato Owned by: nobody
Component: contrib.syndication Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: yes Patch needs improvement: no
Easy pickings: no UI/UX: no


When trying to use protocol-relative URLs (see 1 or 2) like for example returned by django-hosts the syndication framework prepends the protocol and the domain. This way a valid URL is transformed into an invalid or at least useless URL.


class MyFeed(Feed):
    def item_link(self, item):
       url = reverse_crossdomain("myhost", "myview", 
                            view_kwargs={'some': 'argument'})
       return url

The value of url is "" and the rendered feed contains

The syndication framework should either just pass the url as it is or prepend the protocol. For the case of prepending the protocol a patch is attached

Attachments (1)

patch.diff (1.2 KB) - added by cato 5 years ago.

Download all attachments as: .zip

Change History (3)

comment:1 Changed 5 years ago by Aymeric Augustin

Needs tests: set
Triage Stage: UnreviewedAccepted

This bug is described in the comments of #16727.

Changed 5 years ago by cato

Attachment: patch.diff added

comment:2 Changed 5 years ago by Aymeric Augustin

Resolution: fixed
Status: newclosed

In [17108]:

(The changeset message doesn't reference this ticket)

Note: See TracTickets for help on using tickets.
Back to Top