1
0
mirror of https://github.com/golang/go synced 2024-11-26 05:27:57 -07:00

net/http: match os.File.Readdir behavior in DotFileHiding

Fixes #67697

Change-Id: I26b26262d885d0704851c08c79e7b2b4872b65ad
Reviewed-on: https://go-review.googlesource.com/c/go/+/598075
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
This commit is contained in:
Sean Liao 2024-07-12 20:14:23 +01:00 committed by Damien Neil
parent 0b7cda77ca
commit 7299212a42

View File

@ -5,6 +5,7 @@
package http_test package http_test
import ( import (
"io"
"io/fs" "io/fs"
"log" "log"
"net/http" "net/http"
@ -40,6 +41,9 @@ func (f dotFileHidingFile) Readdir(n int) (fis []fs.FileInfo, err error) {
fis = append(fis, file) fis = append(fis, file)
} }
} }
if err == nil && n > 0 && len(fis) == 0 {
err = io.EOF
}
return return
} }