From df3c5e0678732e1295d4ba840117da84ebcd5cd0 Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Sat, 5 Aug 2023 04:26:11 +0400 Subject: [PATCH] Oops, use Error() func instead of direct call of ErrorXXX(). --- internal/http/handlers.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/internal/http/handlers.go b/internal/http/handlers.go index 3f4773b..19aa398 100644 --- a/internal/http/handlers.go +++ b/internal/http/handlers.go @@ -79,11 +79,7 @@ func (h *UploadHandlers) Upload(w http.ResponseWriter, r *http.Request) { if leftSpace < fHandler.Size { log.Println("not enough space left in storage, only", leftSpace>>20, "MiB left") - if strings.Contains(r.UserAgent(), "curl") || strings.Contains(r.UserAgent(), "Wget") { - http.Error(w, "Not enough space left, sorry", http.StatusInternalServerError) - } else { - web.ErrorXXX(utils.MainSite(r.Host), http.StatusInternalServerError, "Not enough space left, sorry.", w) - } + Error(w, r, http.StatusInternalServerError, "Not enough space left, sorry.") return }