Skip to content

Commit

Permalink
fix(core): properly add CSP header to fallback routes (#3641)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfernog committed Mar 8, 2022
1 parent f5efc24 commit bcd4316
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changes/fix-csp-fallback-route.md
@@ -0,0 +1,5 @@
---
"tauri": patch
---

Properly apply the CSP when loading a route that fallbacks to index.html.
2 changes: 1 addition & 1 deletion core/tauri/src/manager.rs
Expand Up @@ -733,7 +733,6 @@ impl<R: Runtime> WindowManager<R> {
// skip leading `/`
path.chars().skip(1).collect::<String>()
};
let is_html = path.ends_with(".html");

let mut asset_path = AssetKey::from(path.as_str());

Expand All @@ -757,6 +756,7 @@ impl<R: Runtime> WindowManager<R> {
.map(Cow::into_owned);

let mut csp_header = None;
let is_html = asset_path.as_ref().ends_with(".html");

match asset_response {
Ok(asset) => {
Expand Down

0 comments on commit bcd4316

Please sign in to comment.