Closed
Description
go version devel +b7a85e000
linux/amd64
What did you do?
Tried to serve shared/icon/favicon.ico/static/shared/icon/favicon.ico
with http.FileServer(http.FS(MY_STATIC_PATH))
.
What did you expect to see?
404
What did you see instead?
500
Diagnosis
The toHTTPError
function (in net/http/fs.go) treats anything other than ErrNotExist and ErrPermission as a 500. But here we have an invalid path—a path that doesn't exist—that happens to go through the existing file shared/icon/favicon.ico
. It should treat that the same as ErrNotExist.