diff --git a/cmd/cory-bin/main.go b/cmd/cory-bin/main.go index 57e5077..57261cd 100644 --- a/cmd/cory-bin/main.go +++ b/cmd/cory-bin/main.go @@ -4,6 +4,7 @@ import ( "bytes" "flag" "fmt" + "io" "log" "log/slog" "net/http" @@ -106,8 +107,15 @@ func serve() { http.Error(w, "output type not supported", 500) return } + all, err := io.ReadAll(r.Body) + if err != nil { + http.Error(w, err.Error(), 500) + return + } + var reader io.ReadSeeker + reader = bytes.NewReader(all) n := nori.New() - if err := n.Decode(r.Body); err != nil { + if err := n.Decode(reader); err != nil { http.Error(w, err.Error(), 500) } frames, err := renderer.RenderAnimationsApng(n)