summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2010-10-28 19:04:33 -0500
committerDan McGee <dan@archlinux.org>2010-10-28 19:04:33 -0500
commitda5d2fb008f6c0d425859c3e1f63942959a33493 (patch)
treec122a4c89ea31c51fb75fefdddc489a9babd27f3
parent50346c5f97b6e9fed91c0f5e28093bd0dad0854e (diff)
Always use HTTPS for jQuery
Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r--main/templatetags/cdn.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/main/templatetags/cdn.py b/main/templatetags/cdn.py
index 43a7f4bc..83ee61fb 100644
--- a/main/templatetags/cdn.py
+++ b/main/templatetags/cdn.py
@@ -9,14 +9,12 @@ def jquery(parser, token):
class JQueryNode(template.Node):
def render(self, context):
- # serve content from HTTPS if we know this request is secure
- secure = 'secure' in context and context['secure']
prefixes = { False: 'http', True: 'https' }
version = '1.4.3'
oncdn = getattr(settings, 'CDN_ENABLED', True)
if oncdn:
- jquery = '%s://ajax.googleapis.com/ajax/libs/jquery/' \
- '%s/jquery.min.js' % (prefixes[secure], version)
+ jquery = 'https://ajax.googleapis.com/ajax/libs/jquery/' \
+ '%s/jquery.min.js' % version
else:
jquery = '/media/jquery-%s.min.js' % version
return '<script type="text/javascript" src="%s"></script>' % jquery