Opened 13 years ago

Closed 12 years ago

#16753 closed Bug (fixed)

Handle protocol-relative URLs in syndication

Reported by: cato Owned by: nobody
Component: contrib.syndication Version: dev
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

Description

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.

Example:

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

The value of url is "example.com/path/to/view/" and the rendered feed contains http://example.com//example.com/path/to/view/.

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 13 years ago.

Download all attachments as: .zip

Change History (3)

comment:1 by Aymeric Augustin, 13 years ago

Needs tests: set
Triage Stage: UnreviewedAccepted

This bug is described in the comments of #16727.

by cato, 13 years ago

Attachment: patch.diff added

comment:2 by Aymeric Augustin, 12 years ago

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