Opened 4 years ago

Closed 4 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 4 years ago.

Download all attachments as: .zip

Change History (3)

comment:1 Changed 4 years ago by aaugustin

  • Needs documentation unset
  • Needs tests set
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

This bug is described in the comments of #16727.

Changed 4 years ago by cato

comment:2 Changed 4 years ago by aaugustin

  • Resolution set to fixed
  • Status changed from new to closed

In [17108]:

(The changeset message doesn't reference this ticket)

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