File tree Expand file tree Collapse file tree 2 files changed +20
-11
lines changed
Expand file tree Collapse file tree 2 files changed +20
-11
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " tauri " : patch
3+ ---
4+
5+ Fixes filesystem and asset scope stripping the first component of the allowed path.
Original file line number Diff line number Diff line change @@ -138,18 +138,22 @@ pub fn parse<P: AsRef<Path>>(
138138) -> crate :: api:: Result < PathBuf > {
139139 let mut p = PathBuf :: new ( ) ;
140140 let mut components = path. as_ref ( ) . components ( ) ;
141- if let Some ( Component :: Normal ( str) ) = components. next ( ) {
142- if let Some ( base_directory) = BaseDirectory :: from_variable ( & str. to_string_lossy ( ) ) {
143- p. push ( resolve_path (
144- config,
145- package_info,
146- env,
147- "" ,
148- Some ( base_directory) ,
149- ) ?) ;
150- } else {
151- p. push ( str) ;
141+ match components. next ( ) {
142+ Some ( Component :: Normal ( str) ) => {
143+ if let Some ( base_directory) = BaseDirectory :: from_variable ( & str. to_string_lossy ( ) ) {
144+ p. push ( resolve_path (
145+ config,
146+ package_info,
147+ env,
148+ "" ,
149+ Some ( base_directory) ,
150+ ) ?) ;
151+ } else {
152+ p. push ( str) ;
153+ }
152154 }
155+ Some ( component) => p. push ( component) ,
156+ None => ( ) ,
153157 }
154158
155159 for component in components {
You can’t perform that action at this time.
0 commit comments