fix: ZIP files always use forward slashes / regardless of the operati…#616
fix: ZIP files always use forward slashes / regardless of the operati…#616fatelei merged 1 commit intolanggenius:mainfrom
Conversation
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
There are also issues in other places, not just in this piece of code. For example, there are problems in the decompression function below the pkg/plugin_packager/decoder/zip as well.Your point is absolutely correct! In the Dify plugin system, there is indeed a serious inconsistency issue with path handling. Because the system needs to handle both ZIP internal paths (must use forward slashes) and Windows file system paths (must use backslashes), the mixed use of path and filepath functions throughout the codebase has led to various bugs. filepath.Join does not handle \ in a way that conforms to the slash standard on Windows. |
…ng system
Description
fix langgenius/dify#32650
Root Cause: In pkg/bundle_packager/memory_zip.go, the code used filepath.Separator (which is \ on Windows) to check for the _assets/ directory prefix in ZIP file paths. ZIP files always use forward slashes / regardless of the operating system, causing the asset detection to fail on Windows.
Type of Change
Essential Checklist
Testing
Bug Fix (if applicable)
Fixes #123orCloses #123)Additional Information
Please provide any additional context that would help reviewers understand the changes.