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

Niko PLP 1 year ago
parent 6f1fe0ba3c
commit 47271552b0
  1. 4
      ngaccount/src/main.rs
  2. 6
      ngaccount/web/index.html

@ -259,7 +259,11 @@ async fn main() -> anyhow::Result<()> {
headers.insert(
"Content-Security-Policy",
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'",
),
);

@ -56,6 +56,12 @@
<body>
<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>
</body>
</html>
Loading…
Cancel
Save