Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net/http: ServeFileFS doc doesn't make sense #66578

Closed
AGWA opened this issue Mar 28, 2024 · 1 comment
Closed

net/http: ServeFileFS doc doesn't make sense #66578

AGWA opened this issue Mar 28, 2024 · 1 comment

Comments

@AGWA
Copy link

AGWA commented Mar 28, 2024

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.

@gopherbot
Copy link

Change https://go.dev/cl/575016 mentions this issue: net/http: correct doc for ServeFileFS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants