Ticket #16753: patch.diff
File patch.diff, 1.2 KB (added by , 13 years ago) |
---|
-
django/contrib/syndication/views.py
8 8 from django.utils.html import escape 9 9 10 10 def add_domain(domain, url, secure=False): 11 if url.startswith('//'): 12 if secure: 13 protocol = 'https' 14 else: 15 protocol = 'http' 16 url = iri_to_uri(u'%s:%s' % (protocol, url)) 11 17 if not (url.startswith('http://') 12 18 or url.startswith('https://') 13 19 or url.startswith('mailto:')): -
tests/regressiontests/syndication/tests.py
303 303 views.add_domain('example.com', 'mailto:uhoh@djangoproject.com'), 304 304 'mailto:uhoh@djangoproject.com' 305 305 ) 306 self.assertEqual( 307 views.add_domain('example.com', '//example.com/foo/?arg=value'), 308 'http://example.com/foo/?arg=value' 309 )