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?
What did you see instead?
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.
The text was updated successfully, but these errors were encountered:
$ go test
HTTP/1.1 404 Not Found
Content-Type: text/plain; charset=utf-8
Date: Sat, 13 Nov 2021 23:51:47 GMT
404 page not found
ok github.com/odeke-em/bugs/golang/49552 0.186s