From 1fb2f490b7f2ba5c222ca0228e8cb0a047b88257 Mon Sep 17 00:00:00 2001 From: matst80 Date: Thu, 15 May 2025 19:55:45 +0200 Subject: [PATCH] cleanup --- main.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/main.go b/main.go index 5c352ee..8f120dc 100644 --- a/main.go +++ b/main.go @@ -161,11 +161,11 @@ func main() { log.Printf("Request: %+v, fileName:%s, method: %s", pth, fileName, r.Method) folder, err := app.GetOrSpawn(pth) if err != nil { - if err != nil { - w.WriteHeader(http.StatusInternalServerError) - w.Write([]byte(err.Error())) - return - } + + w.WriteHeader(http.StatusNotFound) + w.Write([]byte(err.Error())) + return + } if fileName == "" { authKey := r.Header.Get("Authorization") @@ -210,7 +210,6 @@ func main() { w.WriteHeader(http.StatusCreated) } } - w.WriteHeader(http.StatusOK) }) if err := http.ListenAndServe(":8080", mux); err != nil { panic(err)