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)