mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-04-27 03:00:12 -04:00
Fix media_domain being treated as a 3rd party cname
When constucting urls to 3rd party cnames, for example, "thecutelist.com" -> /r/aww, this forces the removal of the `sr_path`. This was unintentionally affecting pages served by the `media_domain`, eg. comment & live embeds.
This commit is contained in:
@@ -588,8 +588,10 @@ def set_iface_lang():
|
||||
c.locale = babel.core.Locale.parse(g.lang, sep='-')
|
||||
|
||||
def set_cnameframe():
|
||||
hostname = request.host.split(":")[0]
|
||||
if (bool(request.params.get(utils.UrlParser.cname_get))
|
||||
or not request.host.split(":")[0].endswith(g.domain)):
|
||||
or not (utils.is_subdomain(hostname, g.domain) or
|
||||
utils.is_subdomain(hostname, g.media_domain))):
|
||||
c.cname = True
|
||||
request.environ['REDDIT_CNAME'] = 1
|
||||
c.frameless_cname = request.environ.get('frameless_cname', False)
|
||||
|
||||
Reference in New Issue
Block a user