bug where a users profile photo would not display if the user had not

logged in
This commit is contained in:
2026-04-06 09:30:15 -04:00
parent 384ef90ea8
commit d0524f901c
2 changed files with 40 additions and 10 deletions

View File

@@ -52,6 +52,17 @@ func CreateFile(path string) (*os.File, error) {
return file, nil
}
func DoesFileExist(path string) (bool, error) {
_, err := os.Stat(path)
if err == nil {
return true, nil
}
if os.IsNotExist(err) {
return false, nil
}
return false, err
}
func HandleFunc(path string, handler func(http.ResponseWriter, *http.Request)) {
logging.Infof("Handling %s", path)
http.HandleFunc(path, handler)