diff options
Diffstat (limited to 'modules-available/main')
-rw-r--r-- | modules-available/main/templates/domain-redirect-check.html | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/modules-available/main/templates/domain-redirect-check.html b/modules-available/main/templates/domain-redirect-check.html new file mode 100644 index 00000000..6019c045 --- /dev/null +++ b/modules-available/main/templates/domain-redirect-check.html @@ -0,0 +1,13 @@ +<script> + document.addEventListener('DOMContentLoaded', function() { + var url = window.location.protocol + '//{{host}}' + window.location.pathname + '?do=_https_magic'; + var magic = "{{magic}}"; + $.post(url, function (data) { + if (!data) return; + if (data.a === magic || data.b === magic) { + // Seems safe to redirect + window.location.host = '{{host}}'; + } + }, 'json'); + }); +</script>
\ No newline at end of file |