mirror of
https://github.com/notherealmarco/WASAPhoto.git
synced 2025-05-05 12:22:35 +02:00
Add file mime type check & switch usercard errors to modal
This commit is contained in:
parent
4cad313aaa
commit
6840c34d7b
3 changed files with 56 additions and 13 deletions
|
@ -4,10 +4,11 @@ package main
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/notherealmarco/WASAPhoto/webui"
|
||||
"io/fs"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"github.com/notherealmarco/WASAPhoto/webui"
|
||||
)
|
||||
|
||||
func registerWebUI(hdl http.Handler) (http.Handler, error) {
|
||||
|
@ -20,6 +21,10 @@ func registerWebUI(hdl http.Handler) (http.Handler, error) {
|
|||
if strings.HasPrefix(r.RequestURI, "/dashboard/") {
|
||||
http.StripPrefix("/dashboard/", http.FileServer(http.FS(distDirectory))).ServeHTTP(w, r)
|
||||
return
|
||||
} else if r.RequestURI == "/" {
|
||||
// Redirect to dashboard
|
||||
http.Redirect(w, r, "/dashboard/", http.StatusTemporaryRedirect)
|
||||
return
|
||||
}
|
||||
hdl.ServeHTTP(w, r)
|
||||
}), nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue