Files
coder/site/site_slim.go
Steven Masley 07cccf9033 feat: disable directory listings for static files (#12229)
* feat: disable directory listings for static files

Static file server handles serving static asset files (js, css, etc).
The default file server would also list all files in a directory.
This has been changed to only serve files.
2024-02-20 15:50:30 -06:00

23 lines
491 B
Go

//go:build !embed
// +build !embed
package site
import (
"io/fs"
"testing/fstest"
"time"
)
func FS() fs.FS {
// This is required to contain an index.html file for unit tests.
// Our unit tests frequently just hit `/` and expect to get a 200.
// So a valid index.html file should be expected to be served.
return fstest.MapFS{
"index.html": &fstest.MapFile{
Data: []byte("Slim build of Coder, does not contain the frontend static files."),
ModTime: time.Now(),
},
}
}