Skip to content

net/http: add ServeContent #2039

Closed
Closed
@bradfitz

Description

@bradfitz
Because http.ServeFile doesn't work with a vfs (yet?) I was trying to use
http.FileServer with a vfs and faking my the http Request.URL.Path to make FileServer
serve the virtual file I wanted.

My input URL was /ui/ and I was faking the request to the VFS for /index.html, because
that's the file I wanted to serve.

The FileServer then redirected me to "/", because it was trying to strip the
index.html from the URL.

That's a bit weird. All other filenames work fine.

I guess I can't use the filename index.html.

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