mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-26 15:28:37 -05:00
Use https urls for s3 hosted header images when we're on a secure domain.
This commit is contained in:
@@ -76,6 +76,9 @@ def external(name):
|
||||
|
||||
return external_resources[name][c.secure]()
|
||||
|
||||
def s3_https_if_secure(url):
|
||||
return url if not c.secure else url.replace("http://", "https://s3.amazonaws.com/")
|
||||
|
||||
def generateurl(context, path, **kw):
|
||||
if kw:
|
||||
return path + '?' + '&'.join(["%s=%s"%(k, url_escape(v)) \
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
################################################################################
|
||||
|
||||
<%!
|
||||
from r2.lib.template_helpers import static
|
||||
from r2.lib.template_helpers import static, s3_https_if_secure
|
||||
from r2.models import Sub, FakeSubreddit
|
||||
from r2.models.subreddit import DefaultSR
|
||||
from r2.lib.pages import SearchForm
|
||||
@@ -41,7 +41,7 @@
|
||||
header_img = d.header
|
||||
header_title = d.header_title
|
||||
%>
|
||||
${img_link(c.site.name, header_img, '/', _id = "header-img-a", img_id = 'header-img', title = header_title)}
|
||||
${img_link(c.site.name, s3_https_if_secure(header_img), '/', _id = "header-img-a", img_id = 'header-img', title = header_title)}
|
||||
|
||||
##keeps the height of the header from varying when there isnt any content
|
||||
|
||||
|
||||
Reference in New Issue
Block a user