feat: support customizable 404 page by sigoden · Pull Request #688 · sigoden/dufs (original) (raw)
take7yo added a commit to take7yo/dufs that referenced this pull request
修复内容
修复 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
[ Show hidden characters]({{ revealButtonHref }})