Skip to content

Commit

Permalink
Merge pull request #186 from GoogleChrome/require-https
Browse files Browse the repository at this point in the history
Redirect to HTTPS for all pages using the new templates.
  • Loading branch information
PaulKinlan committed Jul 24, 2015
2 parents 9406b52 + f60564a commit 41aa982
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
8 changes: 0 additions & 8 deletions _includes/https_redirect.html

This file was deleted.

9 changes: 8 additions & 1 deletion _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,14 @@
<meta name="description" content="Sample illustrating the use of {{ page.feature_name }}.">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{% if page.title %}{{ page.title }}{% else %}{{ page.feature_name }} Sample{% endif %}</title>
{% if page.https_redirect %}{% include https_redirect.html %}{% endif %}
<script>
// If we're running on a real web server (as opposed to localhost on a custom port,
// which is whitelisted), then change the protocol to HTTPS.
// See https://goo.gl/lq4gCo for an explanation as to why this is needed for some features.
if ((!location.port || location.port == "80") && location.protocol != 'https:') {
location.protocol = 'https:';
}
</script>
{% assign sub_dirs = page.url | split: '/' | size | minus: 2 %}
{% capture relative_path_to_root %}{% for i in (1..sub_dirs) %}../{% endfor %}{% endcapture %}
<link rel="icon" href="{{ relative_path_to_root }}images/favicon.ico">
Expand Down
1 change: 0 additions & 1 deletion service-worker/post-message/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
feature_name: Service Worker postMessage()
chrome_version: 45
feature_id: 5163630974730240
https_redirect: true
---

<h3>Background</h3>
Expand Down

0 comments on commit 41aa982

Please sign in to comment.