Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to load resource using "asset:" on "RAMDisk Drive" on windows [bug] #7307

Closed
forestsource opened this issue Jun 27, 2023 · 1 comment
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug

Comments

@forestsource
Copy link

forestsource commented Jun 27, 2023

Describe the bug

An error occurs when the asset files entity is in RAM Disk.
(No problem when files are on SATA/NVMe drive.)

Allow all drives and directories.(I know any security risks.)
tauri.conf.json

  "tauri": {
    "allowlist": {
      "all": false,
      "dialog": {
        "open": true
      },
      "protocol": {
        "asset": true,
        "assetScope": ["**/*"]
      },
      "fs": {
        "readFile": true,
        "readDir": true,
        "exists": true,
        "scope": ["**/*"]
      }
...
    "security": {
      "csp": "default-src 'self'; img-src 'self' asset: https://asset.localhost"
    },

Reproduction

No response

Expected behavior

No response

Platform and versions

[✔] Environment
    - OS: Windows 10.0.19044 X64
    ✔ WebView2: 114.0.1823.58
    ✔ MSVC: Visual Studio Build Tools 2022
    ✔ rustc: 1.69.0 (84c898d65 2023-04-16)
    ✔ Cargo: 1.69.0 (6e9a83356 2023-04-12)
    ✔ rustup: 1.26.0 (5af9b9484 2023-04-05)
    ✔ Rust toolchain: stable-x86_64-pc-windows-msvc (default)
    - node: 19.9.0
    - pnpm: 8.6.3
    - npm: 9.6.3

[-] Packages
    - tauri [RUST]: 1.4.1
    - tauri-build [RUST]: 1.4.0
    - wry [RUST]: 0.24.3
    - tao [RUST]: 0.16.2
    - @tauri-apps/api [NPM]: 1.4.0
    - @tauri-apps/cli [NPM]: 1.4.0

[-] App
    - build-type: bundle
    - CSP: default-src 'self'; img-src 'self' asset: https://asset.localhost
    - distDir: ../dist
    - devPath: http://localhost:1420/
    - framework: React
    - bundler: Vite

Stack trace

"F:" is NTFS formatted RAM Disk Drive.

App.tsx:52  Access to XMLHttpRequest at 'https://asset.localhost/F%3A%5Ctmp%5C%20%5Btest.txt' from origin 'http://localhost:1420' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

Additional context

RAM DISK tool: ImDisk Toolkit
https://sourceforge.net/projects/imdisk-toolkit/
@forestsource forestsource added status: needs triage This issue needs to triage, applied to new issues type: bug labels Jun 27, 2023
@forestsource
Copy link
Author

forestsource commented Jun 27, 2023

Sorry, this problem is on the RAMDISK tool side.
rust-lang/rust#90780

FYI: https://github.com/MolotovCherry/Cargo-RamDrive

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug
Projects
None yet
Development

No branches or pull requests

1 participant