Skip to content

feat: skip directory listing in HEAD requests#701

Merged
sigoden merged 1 commit into
mainfrom
feat
Apr 30, 2026
Merged

feat: skip directory listing in HEAD requests#701
sigoden merged 1 commit into
mainfrom
feat

Conversation

@sigoden

@sigoden sigoden commented Apr 30, 2026

Copy link
Copy Markdown
Owner

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

@sigoden sigoden changed the title feat: skip directory listing for HEAD requests feat: skip directory listing inHEAD requests Apr 30, 2026
@sigoden sigoden changed the title feat: skip directory listing inHEAD requests feat: skip directory listing in HEAD requests Apr 30, 2026
@sigoden sigoden merged commit 82a8865 into main Apr 30, 2026
3 checks passed
@sigoden sigoden deleted the feat branch April 30, 2026 11:55
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant