fix(core): properly add CSP header to fallback routes (#3641)

This commit is contained in:
Lucas Fernandes Nogueira 2022-03-08 12:44:51 -03:00 committed by GitHub
parent f5efc248da
commit bcd43168a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -0,0 +1,5 @@
---
"tauri": patch
---
Properly apply the CSP when loading a route that fallbacks to index.html.

View File

@ -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());
@ -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) => {