1
0

Oops, use Error() func instead of direct call of ErrorXXX().

This commit is contained in:
Alexander Andreev 2023-08-05 04:26:11 +04:00
parent 266cf9dbb0
commit df3c5e0678
Signed by: Arav
GPG Key ID: D22A817D95815393

View File

@ -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
}