File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1156,6 +1156,22 @@ mod tests {
11561156 assert ! ( result. is_err( ) ) ;
11571157 }
11581158
1159+ #[ cfg( unix) ]
1160+ #[ tokio:: test]
1161+ async fn download_destination_rejects_existing_symlink_file ( ) {
1162+ use std:: os:: unix:: fs:: symlink;
1163+
1164+ let root = tempfile:: tempdir ( ) . expect ( "create destination root" ) ;
1165+ let outside = tempfile:: tempdir ( ) . expect ( "create outside directory" ) ;
1166+ let outside_file = outside. path ( ) . join ( "file.txt" ) ;
1167+ std:: fs:: write ( & outside_file, b"outside" ) . expect ( "write outside file" ) ;
1168+ symlink ( & outside_file, root. path ( ) . join ( "file.txt" ) ) . expect ( "create test symlink" ) ;
1169+
1170+ let result = safe_download_destination ( root. path ( ) , & PathBuf :: from ( "file.txt" ) ) . await ;
1171+
1172+ assert ! ( result. is_err( ) ) ;
1173+ }
1174+
11591175 #[ test]
11601176 fn test_select_upload_content_type_uses_guess_for_small_files ( ) {
11611177 let selected =
You can’t perform that action at this time.
0 commit comments