mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-12-15 05:31:42 +03:00
fix(core): properly add CSP header to fallback routes (#3641)
This commit is contained in:
parent
f5efc248da
commit
bcd43168a5
5
.changes/fix-csp-fallback-route.md
Normal file
5
.changes/fix-csp-fallback-route.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"tauri": patch
|
||||
---
|
||||
|
||||
Properly apply the CSP when loading a route that fallbacks to index.html.
|
@ -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) => {
|
||||
|
Loading…
Reference in New Issue
Block a user