Pārlūkot izejas kodu

fix: scope check when using the HTTP API to upload files closes #4312

Lucas Nogueira 3 gadi atpakaļ
vecāks
revīzija
8ce5b76264

+ 5 - 0
.changes/fix-http-multipart-file-validation.md

@@ -0,0 +1,5 @@
+---
+"tauri": patch
+---
+
+Fixes filesystem scope check when using the HTTP API to upload files.

+ 1 - 1
core/tauri/src/endpoints/http.rs

@@ -103,7 +103,7 @@ impl Cmd {
           } = value
           {
             if crate::api::file::SafePathBuf::new(path.clone()).is_err()
-              || scopes.fs.is_allowed(&path)
+              || !scopes.fs.is_allowed(&path)
             {
               return Err(crate::Error::PathNotAllowed(path.clone()).into_anyhow());
             }