mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-25 15:15:19 +00:00
automatically reddirect to secure origin
This commit is contained in:
parent
885f0aba66
commit
fab1326cd8
@ -6,6 +6,10 @@
|
||||
<meta charset="utf-8">
|
||||
<link rel="prefetch" href="/nuxt.sw.js">
|
||||
<script>
|
||||
if (location.host !== 'localhost' && location.protocol === 'http:') {
|
||||
return location.replace(location.href.replace('http://', 'https://'))
|
||||
}
|
||||
|
||||
async function reload() {
|
||||
const html = await fetch(window.location.href).then(r => r.text())
|
||||
if (html.includes('<!-- SW_INIT-->')) {
|
||||
|
Loading…
Reference in New Issue
Block a user