diff --git a/main.go b/main.go index d163eee..aeab68c 100644 --- a/main.go +++ b/main.go @@ -42,7 +42,7 @@ func init() { Views: engine, Prefork: viper.GetBool("FIBER_PREFORK"), UnescapePath: true, - StreamRequestBody: true, + StreamRequestBody: false, }) app.Use("/static", filesystem.New(filesystem.Config{ diff --git a/pages/media.go b/pages/media.go index 1b959b8..81aaa27 100644 --- a/pages/media.go +++ b/pages/media.go @@ -1,9 +1,9 @@ package pages import ( + "io/ioutil" "net/http" - "strconv" - + "codeberg.org/video-prize-ranch/rimgo/utils" "github.com/gofiber/fiber/v2" ) @@ -32,7 +32,11 @@ func handleMedia(c *fiber.Ctx, url string) error { return err } + body, err := ioutil.ReadAll(res.Body) + if err != nil { + return err + } + c.Set("Content-Type", res.Header.Get("Content-Type")); - contentLen, _ := strconv.Atoi(res.Header.Get("Content-Length")) - return c.SendStream(res.Body, contentLen) + return c.Send(body) } \ No newline at end of file