mirror of
https://github.com/golang/go
synced 2024-11-26 03:37: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:
parent
0b7cda77ca
commit
7299212a42
@ -5,6 +5,7 @@
|
||||
package http_test
|
||||
|
||||
import (
|
||||
"io"
|
||||
"io/fs"
|
||||
"log"
|
||||
"net/http"
|
||||
@ -40,6 +41,9 @@ func (f dotFileHidingFile) Readdir(n int) (fis []fs.FileInfo, err error) {
|
||||
fis = append(fis, file)
|
||||
}
|
||||
}
|
||||
if err == nil && n > 0 && len(fis) == 0 {
|
||||
err = io.EOF
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user