Skip to content

Commit

Permalink
Redirect GeoMapFish example to https.
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunner committed Jan 25, 2016
1 parent 6406373 commit a252172
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
11 changes: 11 additions & 0 deletions contribs/gmf/apps/mobile/default.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
/*
* Redirect to https
*/
if (window.location.protocol == 'http:' &&
window.location.hostname != 'localhost') {
var restOfUrl = window.location.href.substr(5);
/** @type {string|WindowLocation} */
window.location = 'https:' + restOfUrl;
}


/**
* The default ngeo template based URL, used as it by the template cache.
* @type {string}
Expand Down
11 changes: 11 additions & 0 deletions contribs/gmf/examples/default.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
/*
* Redirect to https
*/
if (window.location.protocol == 'http:' &&
window.location.hostname != 'localhost') {
var restOfUrl = window.location.href.substr(5);
/** @type {string|WindowLocation} */
window.location = 'https:' + restOfUrl;
}


/**
* The default ngeo template based URL, used as it by the template cache.
* @type {string}
Expand Down
8 changes: 8 additions & 0 deletions externs/closure-compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,11 @@ Navigator.prototype.systemLanguage;
* @type {string}
*/
Navigator.prototype.userLanguage;

/**
* @typedef {{
* protocol: (string|undefined),
* hostname: (string|undefined)
* }}
*/
var WindowLocation;

0 comments on commit a252172

Please sign in to comment.