mirror of
https://github.com/sigoden/dufs.git
synced 2026-06-07 15:59:03 +03:00
[PR #700] [CLOSED] fix: avoid directory listing work for plain HEAD requests #8385
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/sigoden/dufs/pull/700
Author: @jgoedeke
Created: 4/27/2026
Status: ❌ Closed
Base:
main← Head:main📝 Commits (2)
8ef1df2fix: skip plain directory listing on HEAD requestsa193cb0fix: preserve plain HEAD handling for noscript clients📊 Changes
2 files changed (+21 additions, -2 deletions)
View changed files
📝
src/server.rs(+17 -1)📝
tests/http.rs(+4 -1)📄 Description
Supersedes #687.
Today, a plain directory
HEADstill goes through almost the full directory-listing path and only skips the body at the end. That meansHEADcan still pay nearly the same backend cost asGET, even when the caller only wants headers / an existence check. In practice,HEADcan be used as a lightweight directory-existence probe, where only the response status and headers matter.On slow or remote storage, that difference is noticeable. In my Samba-backed setup, a
HEADrequest to a 470-entry directory takes about 49.7s before this change and about 0.14s after it:The previous PR missed one detail: curl-like clients are detected as noscript, so plain directory HEAD could still fall back to the listing path. This version limits noscript detection to GET, which preserves existing GET behavior and lets plain directory HEAD return early.
No new API is added, and this does not change directory GET, ?json, or WebDAV behavior.
References:
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.