mirror of
https://github.com/django/django.git
synced 2025-09-26 12:09:19 +00:00
Replaced multiple startswith in syndication/views.py
This commit is contained in:
parent
34b6b89bd2
commit
4f8cbf08be
1 changed files with 1 additions and 3 deletions
|
@ -19,9 +19,7 @@ def add_domain(domain, url, secure=False):
|
||||||
if url.startswith('//'):
|
if url.startswith('//'):
|
||||||
# Support network-path reference (see #16753) - RSS requires a protocol
|
# Support network-path reference (see #16753) - RSS requires a protocol
|
||||||
url = '%s:%s' % (protocol, url)
|
url = '%s:%s' % (protocol, url)
|
||||||
elif not (url.startswith('http://')
|
elif not url.startswith(('http://', 'https://', 'mailto:')):
|
||||||
or url.startswith('https://')
|
|
||||||
or url.startswith('mailto:')):
|
|
||||||
url = iri_to_uri('%s://%s%s' % (protocol, domain, url))
|
url = iri_to_uri('%s://%s%s' % (protocol, domain, url))
|
||||||
return url
|
return url
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue