mirror of
https://github.com/hay-kot/homebox.git
synced 2025-08-02 15:50:27 +00:00
panic if mime type fails
This commit is contained in:
parent
4cebb81c29
commit
e86ffacebe
1 changed files with 9 additions and 2 deletions
|
@ -107,8 +107,15 @@ func (a *app) LogRoutes(r *chi.Mux) {
|
||||||
var ErrDir = errors.New("path is dir")
|
var ErrDir = errors.New("path is dir")
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
mime.AddExtensionType(".js", "application/javascript")
|
err := mime.AddExtensionType(".js", "application/javascript")
|
||||||
mime.AddExtensionType(".mjs", "application/javascript")
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
err = mime.AddExtensionType(".mjs", "application/javascript")
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func tryRead(fs embed.FS, prefix, requestedPath string, w http.ResponseWriter) error {
|
func tryRead(fs embed.FS, prefix, requestedPath string, w http.ResponseWriter) error {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue