Skip to content

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

Closed
@AGWA

Description

@AGWA

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions