mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-26 23:39:11 -05:00
Preserve secure host when generating URLs with add_sr.
This commit is contained in:
@@ -302,8 +302,14 @@ def add_sr(path, sr_path = True, nocname=False, force_hostname = False, retain_e
|
||||
u.path_add_subreddit(c.site)
|
||||
|
||||
if not u.hostname or force_hostname:
|
||||
u.hostname = get_domain(cname = (c.cname and not nocname),
|
||||
subreddit = False)
|
||||
if c.secure:
|
||||
u.hostname = request.host
|
||||
else:
|
||||
u.hostname = get_domain(cname = (c.cname and not nocname),
|
||||
subreddit = False)
|
||||
|
||||
if c.secure:
|
||||
u.scheme = "https"
|
||||
|
||||
if retain_extension:
|
||||
if c.render_style == 'mobile':
|
||||
|
||||
Reference in New Issue
Block a user