force https://ipc.localhost on ngaccount web page

pull/19/head
Niko PLP 1 year ago
parent 9bf4233e05
commit eae4e3b6c8
  1. 4
      ngaccount/src/main.rs
  2. 6
      ngaccount/web/index.html

@ -259,7 +259,11 @@ async fn main() -> anyhow::Result<()> {
headers.insert( headers.insert(
"Content-Security-Policy", "Content-Security-Policy",
HeaderValue::from_static( HeaderValue::from_static(
#[cfg(debug_assertions)]
"default-src 'self' data:; connect-src ipc: https://ipc.localhost 'self' http://192.168.192.2:3031",
#[cfg(not(debug_assertions))]
"default-src 'self' data:; connect-src ipc: https://ipc.localhost 'self'", "default-src 'self' data:; connect-src ipc: https://ipc.localhost 'self'",
), ),
); );

@ -56,6 +56,12 @@
<body> <body>
<div id="app"></div> <div id="app"></div>
<script>
window.__TAURI__.convertFileSrc = function convertFileSrc(filePath, protocol = 'asset') {
const path = encodeURIComponent(filePath)
return `${protocol}://localhost/${path}`
}
</script>
<script type="module" src="/src/main.js"></script> <script type="module" src="/src/main.js"></script>
</body> </body>
</html> </html>
Loading…
Cancel
Save