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:
David Wick
2015-02-02 15:10:38 -08:00
parent 491fa288a3
commit d70b844093

View File

@@ -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)