mirror of
https://github.com/coder/coder.git
synced 2025-07-18 14:17:22 +00:00
* 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.
23 lines
491 B
Go
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(),
|
|
},
|
|
}
|
|
}
|