Conversation
take7yo
added a commit
to take7yo/dufs
that referenced
this pull request
Jun 11, 2026
## 修复内容 修复 v0.46.0 文件/文件夹上传返回 404 错误的问题。 ### 根因 PR sigoden#670 (commit a118c13) 引入的 guard_root_contained 方法对所有请求无条件执行符号链接检查,包括尚不存在的路径。当上传到新目录时,fs::canonicalize 失败导致返回 404。 ### 修复方案 在 guard_root_contained 调用前添加 !is_miss 检查,恢复 v0.45.0 行为: - 非存在路径跳过符号链接检查 - 允许上传文件到新目录 - 允许上传嵌套文件夹 - 对已存在路径仍执行安全检查 ## CI 变更 - 替换 release.yaml 为 build.yaml(不发布 Docker/crates.io) - 添加 Windows 构建目标(x86_64-pc-windows-msvc, aarch64-pc-windows-msvc) - 设置为正式发布(非 pre-release) ## v0.46.0 主要变更(相对 v0.45.0) - a118c13 fix: ensure symlink inside serve root (sigoden#670) - a88a4ee feat: support ?json on file path (sigoden#686) - 0ccc2cf feat: support customizable 404 page (sigoden#688) - 43c7781 fix: tweak auth logic (sigoden#689) - 19dc2c2 fix: http range underflow (sigoden#690) - 53ea692 feat: enhence log format (sigoden#692) - b87f876 feat: webui confirm on exit while uploading (sigoden#693) - 82a8865 feat: skip directory walking in HEAD requests (sigoden#701) - 3ac409c fix: liblzma dynamic linking issues on MacOS (sigoden#712) - 5df9265 refactor: webui add css color variables (sigoden#710)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Historically, dufs would walk the fs to gather paths even for HEAD requests. This meant that when there were many paths, response times could be quite lengthy.
This PR allows dufs to skip fs walks in HEAD requests. Make HEAD request response times really fast.
Close #700