aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2023-05-21 20:05:41 +0200
committerFlorian Fischer <florian.fischer@muhq.space>2023-05-21 20:05:41 +0200
commita83a4dece2b56b22d2d341b219656c5b63ebad86 (patch)
treea463f3eb98ab63555905b40c75adc40eabf44f01
parent5ee0fb4aa53e02a4b6c2ffb3d5bfa3a6153c9a06 (diff)
downloadWRMS-a83a4dece2b56b22d2d341b219656c5b63ebad86.tar.gz
WRMS-a83a4dece2b56b22d2d341b219656c5b63ebad86.zip
use io.ReadAll instead of the deprecated ioutil.ReadAll
-rw-r--r--upload.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/upload.go b/upload.go
index ce11462..8333b25 100644
--- a/upload.go
+++ b/upload.go
@@ -7,7 +7,7 @@ import (
"os"
"path"
// "path/filepath"
- "io/ioutil"
+ "io"
"github.com/dhowden/tag"
"muhq.space/go/wrms/llog"
@@ -34,7 +34,7 @@ func NewUploadBackend(uploadDir string) *UploadBackend {
}
func (b *UploadBackend) upload(w http.ResponseWriter, r *http.Request) {
- data, err := ioutil.ReadAll(r.Body)
+ data, err := io.ReadAll(r.Body)
if err != nil {
llog.Warning("Failed to read request body: %s", string(data))
http.Error(w, "Failed to read request body", http.StatusInternalServerError)