Skip to content

Commit

Permalink
fix(core): fallback to {asset}/index.html before index.html, closes
Browse files Browse the repository at this point in the history
  • Loading branch information
amrbashir committed Aug 2, 2021
1 parent cf9f6aa commit d22da65
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changes/core-asset-fallback.md
@@ -0,0 +1,5 @@
---
"tauri": patch
---

Assets will now fallback to `<uri>/index.html` before `/index.html`, allowing anchor links to work as expected.
1 change: 1 addition & 0 deletions core/tauri/src/manager.rs
Expand Up @@ -353,6 +353,7 @@ impl<R: Runtime> WindowManager<R> {

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

0 comments on commit d22da65

Please sign in to comment.