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

master
Niko PLP 9 months 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(
"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