Skip to content

Commit

Permalink
Support https for UIModule javascript_files and css_files.
Browse files Browse the repository at this point in the history
  • Loading branch information
bdarnell committed May 1, 2011
1 parent f04b2dc commit bae1b57
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tornado/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,12 +446,14 @@ def render(self, template_name, **kwargs):
if head_part: html_heads.append(_utf8(head_part))
body_part = module.html_body()
if body_part: html_bodies.append(_utf8(body_part))
def is_absolute(path):
return any(path.startswith(x) for x in ["/", "http:", "https:"])
if js_files:
# Maintain order of JavaScript files given by modules
paths = []
unique_paths = set()
for path in js_files:
if not path.startswith("/") and not path.startswith("http:"):
if not is_absolute(path):
path = self.static_url(path)
if path not in unique_paths:
paths.append(path)
Expand All @@ -470,7 +472,7 @@ def render(self, template_name, **kwargs):
paths = []
unique_paths = set()
for path in css_files:
if not path.startswith("/") and not path.startswith("http:"):
if not is_absolute(path):
path = self.static_url(path)
if path not in unique_paths:
paths.append(path)
Expand Down

0 comments on commit bae1b57

Please sign in to comment.