Skip to content

Commit d22da65

Browse files
authored
fix(core): fallback to {asset}/index.html before index.html, closes #2328 (#2329)
1 parent cf9f6aa commit d22da65

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

Diff for: .changes/core-asset-fallback.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"tauri": patch
3+
---
4+
5+
Assets will now fallback to `<uri>/index.html` before `/index.html`, allowing anchor links to work as expected.

Diff for: core/tauri/src/manager.rs

+1
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,7 @@ impl<R: Runtime> WindowManager<R> {
353353

354354
let asset_response = assets
355355
.get(&path.as_str().into())
356+
.or_else(|| assets.get(&format!("{}/index.html", path.as_str()).into()))
356357
.or_else(|| {
357358
#[cfg(debug_assertions)]
358359
eprintln!("Asset `{}` not found; fallback to index.html", path); // TODO log::error!

0 commit comments

Comments
 (0)