You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks like the Godoc for http.ServeFileFS was copied verbatim from http.ServeFile. In particular, the mention of a "current directory" doesn't make any sense when serving from an fs.FS:
If the provided file or directory name is a relative path, it is interpreted relative to the current directory and may ascend to parent directories. If the provided name is constructed from user input, it should be sanitized before calling ServeFile.
I think the rest of the documentation is correct, except that ServeFile needs to be replaced by ServeFileFS in a few places.
The text was updated successfully, but these errors were encountered:
It looks like the Godoc for
http.ServeFileFS
was copied verbatim fromhttp.ServeFile
. In particular, the mention of a "current directory" doesn't make any sense when serving from anfs.FS
:I think the rest of the documentation is correct, except that
ServeFile
needs to be replaced byServeFileFS
in a few places.The text was updated successfully, but these errors were encountered: