Skip to content

Commit 1e1dc1c

Browse files
author
Florence Yeun
committed
Remove c.authorized_cname
Remove all occurrences of `c.authorized_cname`, which is no longer set by `set_cnameframe()`.
1 parent fcc6b08 commit 1e1dc1c

File tree

7 files changed

+6
-9
lines changed

7 files changed

+6
-9
lines changed

r2/r2/controllers/toolbar.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def GET_s(self, urloid):
142142
listing = hot_links_by_url_listing(path, sr=c.site, num=1)
143143
link = listing.things[0] if listing.things else None
144144

145-
if c.cname and not c.authorized_cname:
145+
if c.cname:
146146
# In this case, we make some bad guesses caused by the
147147
# cname frame on unauthorised cnames.
148148
# 1. User types http://foo.com/http://myurl?cheese=brie

r2/r2/lib/cookies.py

-2
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ def __init__(self, value, expires=None, domain=None,
4949
self.httponly = httponly
5050
if domain:
5151
self.domain = domain
52-
elif c.authorized_cname and not c.default_sr:
53-
self.domain = utils.common_subdomain(request.host, c.site.domain)
5452
else:
5553
self.domain = g.domain
5654

r2/r2/lib/pages/pages.py

-1
Original file line numberDiff line numberDiff line change
@@ -1121,7 +1121,6 @@ class LoginFormWide(CachedTemplate):
11211121
"""generates a login form suitable for the 300px rightbox."""
11221122
def __init__(self):
11231123
self.cname = c.cname
1124-
self.auth_cname = c.authorized_cname
11251124
CachedTemplate.__init__(self)
11261125

11271126
class SubredditInfoBar(CachedTemplate):

r2/r2/lib/template_helpers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ def js_config(extra_config=None):
197197
# current domain
198198
"cur_domain": get_domain(cname=False, subreddit=False, no_www=True),
199199
# where do ajax requests go?
200-
"ajax_domain": get_domain(cname=c.authorized_cname, subreddit=False),
200+
"ajax_domain": get_domain(cname=False, subreddit=False),
201201
"stats_domain": g.stats_domain or '',
202202
"stats_sample_rate": g.stats_sample_rate or 0,
203203
"extension": c.extension,

r2/r2/templates/framebuster.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555

5656

5757
<%def name="framebuster()">
58-
%if c.cname and not c.user_is_loggedin and not c.authorized_cname:
58+
%if c.cname and not c.user_is_loggedin:
5959
<%
6060
import random
6161
from r2.lib.template_helpers import get_domain

r2/r2/templates/login.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ <h3 id="cover-msg" class="modal-title">
5656
tabindex = 2 if register else 3
5757
%>
5858
<form id="${'register' if register else 'login'}-form" method="post"
59-
action="${add_sr(base + '/post/' + op, nocname=not c.authorized_cname)}"
59+
action="${add_sr(base + '/post/' + op, nocname=True)}"
6060
class="form-v2">
6161
%if c.cname:
6262
<input type="hidden" name="${UrlParser.cname_get}"
@@ -155,7 +155,7 @@ <h3 id="cover-msg" class="modal-title">
155155
tabindex = 2 if register else 3
156156
%>
157157
<form id="login_${op}" method="post"
158-
action="${add_sr(base + '/post/' + op, nocname=not c.authorized_cname)}"
158+
action="${add_sr(base + '/post/' + op, nocname=True)}"
159159
class="user-form ${'register-form' if register else 'login-form'}">
160160
%if c.cname:
161161
<input type="hidden" name="${UrlParser.cname_get}"

r2/r2/templates/loginformwide.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
base = g.https_endpoint if not thing.cname else ''
3434
%>
3535
<form method="post"
36-
action="${add_sr(base + '/post/login', nocname=not thing.auth_cname)}"
36+
action="${add_sr(base + '/post/login', nocname=True)}"
3737
id="login_${op}"
3838
class="login-form login-form-side">
3939
%if thing.cname:

0 commit comments

Comments
 (0)